The Ur Project

Documenting the craft of stacking things so they remain stacked. For a very long time.

Fe2O3.nH2O

Babylonic catastrophes

There's a biblical story where a deity punishes all of humanity for building a stack of rocks in a really good way. The punishment is that humanity becomes scattered into different languages and somehow, according to the story, this is a bad thing.

The truth of course is that language isn't something that is static. It evolves because it's invented by people. Made up, even. As people do their thing in the world they live in, they'll start making up nonsense words. New words will get adopted if used by more people, and so on. At the same time, people tend to explore and colonize new regions to see if living is better there. So people drift away from each other and the language evolves as well as distances grow.

This isn't an analogy of computer programming languages. They tend to be mostly static and are rooted in how well a programming language covers all the basics and edge cases, but largely the programming languages tend to stay the same. The C programming language arguably is an outlier as it evolved from plain C, to C++, and into wild dialects like C# and you might even consider Swift or PHP or JavaScript a form of evolution of C.

I'm a big fan of C

It's the perfect high school grade, for one. It's also a pleasant note on most instruments. A is a little high for me. A C note also is a good amount of change. But enough about C puns.

I'm picking Rust as a programming language for some very mundane reasons. I've done enough C coding to know that ... it works. It takes a lot of care to write really high performant or reentrant C code. I can deliver good C code because I've taught myself not to trust my own code, but verify. Write tests. Do code coverage. Do static analysis. Repeat when code changes. All that stuff.

But it gets a little old in ways to do C. Some things are terribly elaborate in C++ already. In C they become large code bases quickly. A lot of things have to be done by hand in the Linux Kernel, for instance. There isn't just a library that you can pull in. It's not for nothing that the Linux kernel community jumped on the Rust programming language early on. Rust has been around for a long time, but adoption was slow to start. Perhaps because of Golang and other languages taking a bit of a lead, and Rust still being at its infancy.

Languages Mutate

One of the things I was surprised by was how cargo does test coverage, and in a way that exposes whether your testing is inadequate or not, in a different way. It means running cargo-mutants and letting it manipulate your code branches to see how it breaks or doesn't break your test cases.

Pair that with the type safety that Rust offers and you have a solid recipe for making decent code, and avoiding terrible code to begin with. That's a great start for any language that wishes to replace C as the default.

I can't say that it hasn't been helpful that LLMs are pretty darn good at leveraging these tools to produce better code. They most certainly are, and still they improve.

Adieu

I'm saying goodbye for now to interpreted languages as being part of the lower level OS. I'm at a point now where I feel that even Bash doesn't belong in the lower OS levels anymore. Python certainly shouldn't be part of any OS. Perl is for people who are about 5+ years older than me. JavaScript is for web browsers (and what a sad thing it is that people try and make actual real programs with it).

I think they're fine for experiments. I think they're fine for high school level projects. But at the Uni level people really should not be using npm unless they're doing security research into how heavily the npm repositories are infested with malignant code. It's not a risk I want to take. Any ecosystem that allows OSS contributions already has a hard time right now with bad actors lurking to invade them.

I'll make a small detour and say that Lua as an embedded scripting language in lieu of bash/python/node is a sane choice. It's really small and clean enough that it's not a wild west ecosystem. It works. It's the go-to scripting language for many projects already. But that's as far as I want to go for now. There's not really many places where this project will rely on it - rpm macros are entirely replaced with triggers thus far.

So the Ur Project is entirely in Rust. At least the code I'm writing for this project. There's a few minor things I wrote for Clear Linux OS that were written in C that needed work to adopt, so I opted to re-implement those in Rust as well. They're hosted in the same forgejo instance. I couldn't adopt the old C code due to assumptions that held for Clear Linux OS but are no longer valid in this project.

--sofar (aka Auke)