4 ms·
If your platform is supported by LLVM, Zig is worth serious consideration. It is able to target any of the operating systems you mention, from any of the operat
by samatman 2y ago
If your platform is supported by LLVM, Zig is worth serious consideration. It is able to target any of the operating systems you mention, from any of the operating systems you mention. Linking to the syscall interface / libc / C libraries is straightforward, exporting functions which respect the local ABI is quite simple.
- whobre 2y agoLatest release of zig is 0.13. I guess it’s fine for hobby projects and learning…
- samatman 2y agoIt's true that, as a pre-1.0 language, choosing Zig means taking on the implementation burden of changing code to keep up with language changes. But it's already being used in production in a surprising number of places. Wanting to wait until 1.0 to get started is a respectable choice. I prefer to get a head start, compile against master every few weeks, and change what needs changing.
- thefaux 2y agoAt some point it becomes a bit ridiculous to be pre 1.0 for nearly a decade. It is symptomatic of a level of complexity and confusion about the core language use cases* that is a nonstarter for me. * In other words, I think it's trying to do way too much and would have benefitted from aggressive scope reduction years ago.
- Dylan16807 2y agoAvoiding C's biggest issues can overcome a good amount of pre-1.0 problems.
- yjftsjthsd-h 2y agoFor drivers? I suppose if it has really good C interop that might work... is that a thing?
- SpaghettiCthulu 2y agoYes, Zig has excellent C interop.
- cgh 2y agohttps://ziglang.org/documentation/master/#C https://ziglang.org/documentation/master/#C Zig has near-seamless C interop and the Zig compiler is also C cross-compiler: https://zig.news/kristoff/cross-compile-a-c-c-project-with-zig-3599 https://zig.news/kristoff/cross-compile-a-c-c-project-with-z...
- elcritch 2y agoThe Linux kernel only compiles with GCC the last I heard though. Also the libc is probably different, so I suspect it'd be trickier than expected.
- rascul 2y agohttps://www.kernel.org/doc/html/latest/kbuild/llvm.html https://www.kernel.org/doc/html/latest/kbuild/llvm.html