I’ve been dabbling in OS development. I started with rust and it was… ok. Lots of what you’d expect: unsafe all over the place, weird borrow checker work arounds. It felt like I was bending the languages arm.
I recently started to re implement the (admittedly very basic) kernel in Zig and it’s been a breath of fresh air. The language seems much better suited for the level of abstraction that Osdev lives at. Major bonus is that all the existing C code is directly useable in a zig project without any wrapper nonsense or it can be easily translated.
I think base Rust is a great language, but the ecosystem tends towards very complex and overengineered solutions; with advanced uses/abuses of macros and the type system, trait hell ends up being not too dissimilar to template hell from C++. And the async/await story is plagued with layers and layers of complexity due to the many obtuse interactions with its lifetime system.
Rust honestly probably should've gone with its original idea of green threads/channels, like GC-less Go, but that idea was dropped a long time ago.
"Joy" is always highest for new languages, because there are only green fields and enthusiasts. "Joy" is also increased by languages that let you just do what you want, like dynamic typing, or other language features that delay seeing that first error.
This is a good point. Zig is practically optimized for this: comptime is extremely dynamically typed compared to actual generics, and the lack of memory safety is often "a breath of fresh air"--until you have to actually fix bugs (including security bugs) resulting from it.
It's like the "joy" of a good vacation paid for with a credit card.
I appreciate Zig and hope it succeeds. I don't dismiss the benefits of Rust like some comments though; the borrow checker or unsafe syntax may be a pain now, but so is saving money before a vacation.
> Rust is still popular but it turns out the developer joy is pretty low.
Rust is one of the language I enjoy to use. The problem is you need to overcome its steep learning curve in order to enjoy it, which people tend to give up because it is too hard.
For me, it wasn’t the learning curve that was the problem with Rust. It’s the compilation time. It’s just so slow. I’m used to OCaml, Go, and Typescript (via Bun or esbuild) with iteration times in the tens-to-low-hundreds of milliseconds. Zig still feels a wee bit slow, but it’s acceptable. Rust? It makes me want to toss my laptop into the fire.
To be honest, I haven’t touched Rust in years, so it may have improved.
It has improved continually over the years, but on the order of 3x-5x, and by the way you talk about it, you’re looking for 10x-100x, so I doubt it’s not still an issue for you.
Which to me is fine. It's not a great hobby language but it is a fantastic professional language, precisely because of the ease of refactors and speed of development that comes with the type system and borrow checker.
> It's not a great hobby language but it is a fantastic professional language,
I never thought I'd live to see the day when someone would say this. The first 5 years of Rust were all "this is interesting for hobby projects but nobody will ever adopt this in industry".
The programming world is much larger than this small slice of the internet, though. HN has had several eras of “this is the hot new fad language and you should use it!”, going as far back as Lisp in the mid-2000s.
It will likely continue to experience this cycle until the heat death of the universe.
I'm happy to revise what I said from "Rust keeps winning" to "Rust continually won" if you want to nitpick my choice of verb tenses. It refutes the idea that the "developer joy is pretty low" either way.
I recently started to re implement the (admittedly very basic) kernel in Zig and it’s been a breath of fresh air. The language seems much better suited for the level of abstraction that Osdev lives at. Major bonus is that all the existing C code is directly useable in a zig project without any wrapper nonsense or it can be easily translated.
I think I’ll stick with dig for a bit.