FreeBSD, instead of looking at Rust should look at Zig

I'm, not sure what the extent of "Rust in FreeBSD" is, but I've seen ramblings of it. Honestly I hope it's not true. From the looks of it the Linux guys are kind of regretting it. I don't hate Rust, but at the same time I also don't think it's as amazing and groundbreaking as some are saying. I personally think the hand-holding around memory safety is a step too far and the syntax/conventions are way too out of the ordinary.

That said, there are some improvements that could be had from something "not C". For this I suggest Zig instead. From the looks of it, this might actually be a better option? It seems to have a much better syntax, doesn't do anything too crazy with memory management, and appears to be very compatible with C.
 
From the looks of it the Linux guys are kind of regretting it
Seriously? Can you please provide some links?

I'll provide some as a counterpoint: Linux devs who actually know something about Rust are making a case that some modules/drivers should be re-written in Rust and are actually saying that there are some improvements to be had from something that is "not C":

 
Seriously? Can you please provide some links?
This is quite a good one.

https://www.theregister.com/2025/02/05/mixing_rust_and_c_linux/

I know Greg Kroah-Hartman is one of the main proponants for Rust in the Linux kernel (some of the others stepped down, Hector Martin and Wedson Almeida Filho). I would be interested in a proper survey as to what the developers actually prefer. It isn't clear the ratio of who wants it and who doesn't.

who actually know something about Rust
I do hear many arguments point towards this but I believe it is a slight fallacy to believe that skilled C developers who work on the kernel don't know *enough* about Rust for them to know it is potentially damaging. For one, it isn't that magical, its main patterns (i.e RAII) are well explored, basically coming from being an "enforced" C++.

Plus, the issue with "non-C" languages is always creating bindings (some people in the Rust community are incorrectly calling these abstractions rather than "Fat bindings"). Someone could never have used Rust before and still easily predict these problems due to bindings.

This weakness seems to be where the kernel developers are pushing back rather than the language itself. I would personally love if the Rust community spent their time solving this issue instead rather than lobbying and brigading on twitter, etc.
 
I think we already came to the conclusion that Zig is more suited for the BSD mind than Rust in the big Rust thread:


What I don't know yet is how memory-safe Zig actually is. Golang as a garbage-collected language is a different animal altogether.
 
My understanding of the Linux mess is that you have people like Linus and Greg advocating for Rust, whilst admitting that they don’t use it themselves, or have any great deal of mastery in the tool.

Then you have long term maintainers like Christoph Hellwig saying it’s a very bad idea, and they strongly oppose it going any further in terms of mixing Rust code into the C codebase.

Difference is that Christoph writes Rust code in his regular day job (has for years), and has some basis for forming an opinion.

Linus and Greg’s opinions are based on having read executive summaries and internet articles, without writing any code.

Zig is a very different beast compared to Rust. It’s not “yet another shiny new language”

It is a C compiler and build toolchain, as well as being a general purpose language. It doesn’t need “bindings” - it is perfectly happy working with just C header files already (Mostly.. sort of, depends how bad the macros are)

Zig already handles cross platform builds exceptionally well .. to the point where it’s often used in other tools such as Go or Rust projects to fix their cross platform build pipeline issues.

Zig has some very compelling features on the roadmap too that are just focused on a better developer experience and faster iterations .. and that includes working with existing pure C codebases.
 
What about just focusing on expanding FreeBSD in C and not bloating base with unnecessary trend-of-the-month programming lannguages? My buildworld time and myself will personally thank you!

p.s. What next‽ Java in the kernel, perhaps! The same people who promote these fad-langs will love the idea of crufting-up the damn kernel with a garbage collector!
 
Java in the kernel is so yesterday.

In college, I was taught OS concepts using a Java implementation of a basic kernel. It already had a garbage collector - in 2003! 😏

Come to think of it, i386 was all the rage back then, and 64-bit computing was stuff of legends.
 
Back
Top