Comments by "" (@pierreollivier1) on "Every programming language explained in 15 minutes | Prime Reacts" video.
-
Greatest take ever, Zig should have been the one to go into the Linux kernel (i mean not now because it's not stable) but man this is such the perfect language for kernel development, Like Rust is great don't get me wrong, and I think for pieces of code that must be 100% safe, it can be good, but for everything else, It's Zig or C. I'm quite sure that once it matures it will actually just replace most of C code out there, because it has such a great ergonomic and it is such a great language to do everything like you would in C, but better, faster, safer, and without sacrificing the maintainability. Like honestly recently I wanted to go look for implementation details for libc, and I swear it's actually physically painful and emotionally bruising to look a libc code. Even with goto definition of the lsp, you just jump around in 40 different files of private macro definiton of function embedded macro in 50 #ifndef, #elif, #define, using weird type_t crap, it's terse, ugly, horrendous, and I think that it should be removed from this planet. On the other hand I basically learned Zig by reading the code of the compiler, because of how readable, expressive and easy it is to parse with the eyes.
2
-
@SystemAlchemist Yes I know, I don't even think it was on the Radar when Rust was proposed to it into the kernel, so within that realm, it was sensible to take Rust over anything at the moment. Rust is just such not a Kernel language tho, that's the thing, so I just hope they don't let it grow too much. As for Zig I'm curious about what you think is sloppy within the language ? It's surely a young and immature language, but as a C developer, I can tell you that this is only improvement over what I'm using currently, and If I could I would gladly avoid the annoyance and mental load that come with a language like C. I mean I get, an actually usable STD, memory allocator are first class citizen, so the STD can be used on freestanding target. The build system is also in Zig, and can build and cross compile C, there's already a package manager (although very primitive at the moment). You can use all C libraries, so you already have one of the most extensive ecosystem at your disposal, embedded unit test framework, so tests are inexpensive, and can live with the code they are meant to test. It's extremely readable, you have more control than C, but also more safety features, and more debugging tools. It's honestly an amazing C. But I'd be glad to hear what you think Zig is lacking, because obviously it's far from perfect, and it's still very quirky.
1