Kinda forgot how much fun it was to write code stitching map tiles together, and also how easy it was. Currently at 82 lines of #PHP. Once finished it will be a new package, as the #golang has some massive glaring bug in it that took me 6 years to find. Sprinkling some threads and #AMQP over this once it's done. The home clusters fans will sing once more
I think this is something all #golang devs should be aware of to avoid similar vulnerabilities.
The language is kind of amazing:
Step 3. only applies if there is a parent path to be eliminated together with the subsequent “..” (“/foo/..” -> “/“)
Step 4. only applies to “rooted” (absolute) paths, so “/../foo” would become “/foo”, but “../“ is left untouched (as there is no relative parent path to eliminate either).
This makes the docs technically correct (“the best kind of correct!”), but even with the solution at hand it took some head scratching to figure out the true meaning.
For a work project it seems we will have to implement a #golang library for building/evaluating ODRL statements. Since I haven't previously started such a parser library project, I would like suggestions on projects I could look at for inspiration in
Ease of use in interfaces
Test structure
Generally nice code
Please post links to projects you think are nice to use. Oh, and please boost for bigger reach.
I can't deal with languages with optional semicolons! I like languages without semicolons, but when they're optional, especially if they feel "C-like", I always end up adding semicolons to some lines even when I try to write in a semicolon-less style. I'm writing some #kotlin now and I decided to just use semicolons consistently because the alternative is seemingly to use them inconsistently.
Strangely, this isn't an issue I have in #golang. I do have it in #rust however.
Current status: I opened about 100 links to articles and threads from Google results comparing #ruby, #golang and #rustlang and I'm planning to read them 🫠
(no, I'm not really considering Go, mostly just trying to convince myself that I'm not making a mistake starting to learn Rust and not Go 🦀😛)
It's insane that I can have a conversation with this thing and in a few moments and a few back and forths build a working program in a language I know nothing about (I don't know Go)… don't tell me this isn't huge 😳 #golang#chatgpt
I released a new version of my #GoLang module for persistent message queues based on #SQLite today. I added a basic job runner, since that’s one of the things I most use a queue for. Check it out at https://www.goqite.com
I'm going to host an online workshop for the Gentoo e.V. on 2024-06-15 about how to "Host Gentoo dependency tarballs as GitHub releases".
I'll show how to use GitHub for dependency tarballs as an external #Gentoo#contributor, such as a proxied maintainer, a GURU committer, or an overlay #maintainer.
I use this approach to package #opensource#Golang software, and it can be applied to other similar situations, or even automated through local scripts or GitHub Actions.
#golang's core crypto/tls library merged client #ECH support! It should be included in the Go v1.23 release. Server-side support is still in the works.
I'd like to find more YouTube channels about software development / engineering / etc but it's like 98% of the same white guy, screaming like a twitch streamer, making almost every video about "this is X killer" "why you should NEVER do that" or "your IDE is shit use X instead". Of course they talk like they are the thing and it's the only truth.
This weekend, I hacked together a markdown documentation generator for Postgres in Go. It should be extensible to other databases, as well as including other properties from database.
Just a few thoughts on programming languages that have been rattling around in my head this week, but which don’t each merit a full blog post. The main theme is that the culture behind each programming language leads to some interesting choices, as is the case with spoken languages.
This week I started learning how to program in Rust. Even though I’m using the project-based Command-Line Rust to learn, the author still went with the traditional “Hello, world!” project for the first intro to the language. I was also working on a Go project last week and so it immediately stood out to me that (at least as taught by this author) Rust has the print! macro that allows you to succinctly print to the command line. By contrast, Go requires importing fmt before you can print. This was the first topic that was swirling around in my head this week. What makes language designers choose whether printing output (one of the most basic things a program can do) is built-in or requires an import. I even remember back when I was learning Java in undergrad (I think it was Java 1.8, but I don’t remember) we had to use the savitch library just to get program input (another very basic computer program concept). As I thought about it, I wondered if it has to do with thoughts around compilation and whether the language designers think you’re mostly making user-interactive programs or libraries? It makes sense to me that scripting languages like Python, Ruby, and Perl would have print built-in since you always have to have the interpreter along with you, so all the basics should be there. (The original Batteries Included Python promise, for example) But perhaps the Go developers thought you wouldn’t always be printing to the command line so a more efficient binary could be compiled by forcing you to import the functionality? I’m not entirely sure.
The next thing I started thinking about, again due to learning Rust, was the mutability of variables. In most languages I’ve come across (I think all, except Haskell) all variables are mutable by default. It almost seems pointless to have a non-mutable variable. I understand why many languages have the concept of a “contanst” modifier/keyword. Unlike normal variables, THIS ONE does not change. But the opposite seems so weird since most of what we often do in programming involves changing the value in a variable. Perhaps as I learn more about Rust, I’ll understand their reasoning, but this seems completely backwards to me.
Both Rust and Golang use structs to organize variables where Ruby, Python, and Java use objects. But when both Go and Rust allow you to “attach” methods/functions to structs – is there a true distinction between object-oriented programming and struct-based programming? It seems like it’s just semantics (in the generic sense of the word) – at least at the level at which I program. The only difference I can see is that structs don’t have inheritance, although Go’s “types” solve some of the same problems.
Today’s (the day I’m writing this, not the day it’s going to be posted) shower thought was about programming language versions. On one end you have Java (I think now on version 22) and C# (now at version 12). On the other you have Python and Ruby (both at version 3). Perl essentially stopped at 5 with Perl 6 evolving into Raku. I don’t know what Java is up to. But I think C# is actually using the versions correctly – I’ve heard that each version introduces completely different ways of doing things and that the way you program C# depends strongly on when you jumped in. This is why Python is probably never moving to v4 unless they need to make some kind of huge change. Rust is an outlier with year-based versions. I guess that’s fine, but doesn’t tell you anything like a proper semantic versioning could.
Finally, I know that Rust is the newest of all the programming languages I’ve learned, but I really love how new projects are started. Python isn’t horrible, but it’s currently suffering from a lots of ideas, none of which has complete market share. You could do a simple virtual environment or you could do a more complex virtual environment/lock file situation with Poetry. (And there are about another half dozen variations on these two themes) But Rust….Rust deserves a chef’s kiss. When you start a new project with “cargo new project-name”, not only does it set up your directory structure, but it does a whole bunch of great setup tasks. It creates your Cargo.toml file (with Python, which only really started supporting toml files at the project level a few years ago, you need to look at documentation to figure out what goes in there) so that you have all the basics in there already. But it doesn’t stop there! It also, in a nod to modern programming, creates a git repository AND a gitignore file. It’s a thing of beauty. I would absolutely love for Python to move in this direction officially (not through a random user choice) for their defaults. Even “go mod init” could benefit from setting up a git repo and a git ignore (since the toml is not how Go works – I think they would probably best set up a README.md since Go’s default packaging is through git repos).