| ▲ | Ygg2 4 hours ago | |
> Rust is not designed for low level system programming / embedded systems like Zig is. Pray tell, with Rust already being used in kernels, drivers, and embedded what makes Zig better suited for low-level systems? More chance to explode a UB in your hand? For that, there is C. | ||
| ▲ | GuB-42 3 hours ago | parent [-] | |
Great C interop, first class support for cross-compilation, well suited for arena allocators. You can use Rust in kernel/embedded code, you can also use C++ (I did) and even Java! but most prefer to use C, and I think that Zig is a better alternative to C for those in the field. There is still one huge drawback with Zig and that's maturity. Zig is still in beta, and the closest you get to the metal, the more it tends to matter. Hardware projects typically have way longer life cycles and the general philosophy is "if it ain't broke, don't fix it". Rust is not as mature as C by far, there is a reason C is still king, but at least, it is out of beta and is seeing significant production use. I remember when I talk about Zig to the CTO of the embedded branch of my company. His reaction was telling. "I am happy to hear someone mention Zig, it is a very interesting language and it is definitely on my watch list, but not mature enough to invest in it". He was happy that I mentioned Zig because in the company, the higher ups are all about Rust because of the hype, even though we do very little of if BTW, it is still mostly C and C++. And yeah, hype is important, customers heard about Rust as some magical tech that will make the code bug-free, they didn't hear about Zig, so Rust sells better. In the end, they go for C anyways. | ||