• 5 Posts
  • 33 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle

  • I was about to start learning Perl in a proper way, but always decided against it. I just can’t find a good reason for myself to write Perl code. Unless you want to read or edit others Perl code, what is the reason to learn it? GNU+Bash and Python are often enough for me.

    So why learning and using Perl in modern age and day as a newcomer to the language? Look, I’m not negative here, just asking honest question. Because I am actually searching for good reasons to learn Perl.






  • But that mathematical pseudo code has nothing in common with the walrus operator := in Python and Go. They are just the same symbols, but with a totally different meaning and use case. Its an operator designed specifically for programming languages, because that is not applicable to mathematics at all. In mathematics you don’t have an assignment operator a = 69 that cannot be used as part of an expression. Therefore you don’t need a dedicated := that yields an expression that can be used as part of an expression and create a variable if its not already. (Edit: I’m so sick of my stupidness.)


  • Turns out it was introduced in 3.8, released in 2019, so it was much too late to inspire Go

    You are probably right about that. But don’t forget that the operator didn’t made it day one, there was lot of discussion before and probably testing it in the beta releases before. But given how old Golang at that point is, you are right about my take on inspiration. This operator wasn’t a new invention in Python.

    It also has a substantially different meaning than in Go.

    I don’t know if there’s an “official” rationale for the Go syntax, but := is a fairly common (but not ubiquitous) math notation meaning “define the thing on the left to be equal to the expression on the right”, i.e. to distinguish it from the other use of =, i.e. “the expression on the left must be equal to the expression on the right.”

    Does it though? In both cases, Go and Python, the operator will assign a variable a value and also use it as an expression. That is useful in cases like for loops or other cases where you want immediately use the variable content as an expression. This cannot be done with the regular assignment operator a = 69, which itself is not an expression. So in practical terms, its the same in usability for Go and Python. So its doing the same for both languages and has the same differences to the assignment operator. (Edit: Read the reply, I learned something myself. That’s why its important that you don’t blindly teach people like I did.)



  • The := operator is called walrus operator and is inspired by Python I think. It’s declaring a variable and assigning it in one go. map[string] int is defining a map (associative array or also known as dictionary in Python), with string as key type and int as value type. And the following {} is the body of the associative array, meaning empty content.

    I only played a bit with Go and did basic tutorials. I might go back to it at some point, but Zig is much more appealing to me. Go is too simple in the language to me, but on the other side, this is exactly whats appealing.





  • I copied the sub-headings from the document, serving as an overview:

    • Introducing Windows Copilot Runtime to provide a powerful AI platform for developers
    • New experiences built using the Windows Copilot Runtime
    • Windows Copilot Library offers a set of APIs helping developers to accelerate local AI development
    • Introducing Windows Semantic Index that redefines search on Windows. Vector Embeddings API offers the capability for developers to build their own vector store with their app data
    • Windows is the first platform to have a state-of-the-art SLM shipping inbox and Phi Silica is custom built for the NPUs in Copilot+ PCs
    • Developers can bring their own models and scale across breadth of Windows hardware powered by DirectML
    • PyTorch is now natively supported on Windows with DirectML
    • DirectML now supports web apps that can take advantage of silicon to deliver AI experiences powered by WebNN
    • High-performance inferencing on Windows with ONNX Runtime and DirectML
    • New experiences designed to help every developer become more productive on Windows 11
    • Environments in Dev Home help centralize your interactions with all remote environments. Create, manage, launch and configure dev environments in a snap from Dev Home
    • Windows Customization in Dev Home allows developers to customize their device to an ideal state with fewest clicks
    • New Export feature in Dev Home Machine Configuration allows you to quickly create configuration files to share with your teammates, boosting productivity
    • Dev Drive introduces block cloning that will allow developers to perform large file copy operations, instantaneously
    • Sudo for Windows allows developers to run elevated commands right in Terminal
    • New Source code integration in File Explorer allows tracking commit messages and file status directly in File Explorer
    • Continuing to innovate and accelerating development for Windows on Arm
    • Continuing investments in WinUI3 and WPF to help developers build rich, modern Windows applications
    • WinUI 3 and Windows App SDK now support native Maps control and .NET 8
    • Windows 11 theme support makes it easy to modernize the look and feel of your WPF applications
    • Extend Windows apps into 3D space
    • Building for the future of AI on Windows






  • Basically another shell scripting language. But unlike most other languages like Csh or Fish, it can compile back to Bash. At the moment I am bit conflicted, but the thing it can compile back to Bash is what is very interesting. I’ll keep an eye on this. But it makes the produced Bash code a bit less readable than a handwritten one, if that is the end goal.

    curl -s "https://raw.githubusercontent.com/Ph0enixKM/AmberNative/master/setup/install.sh" | $(echo /bin/bash)

    I wish this nonsense of piping a shell script from the internet directly into Bash would stop. It’s a bad idea, because of security concerns. This install.sh script eval and will even run curl itself to download amber and install it from this url

    url="https://github.com/Ph0enixKM/${__0_name}/releases/download/${__2_tag}/amber_${os}_${arch}" … echo “Please make sure that root user can access /opt directory.”;

    And all of this while requiring root access.

    I am not a fan of this kind of distribution and installation. Why not provide a normal manual installation process and link to the projects releases page: https://github.com/Ph0enixKM/Amber/releases BTW its a Rust application. So one could build it with Cargo, for those who have it installed.