3 ms·
Have you looked into Zig (https://ziglang.org/ https://ziglang.org/)? It's a little more than what you've asked since it does support compile time generics. But
by nimrody 7y ago
Have you looked into Zig (https://ziglang.org/ https://ziglang.org/)? It's a little more than what you've asked since it does support compile time generics. But is specifically targeted at removing undefined behavior and improving safety.
- audunw 7y agoI can second this recommendation. Zig is really the best language I seen so far at attempting to be a direct replacement to C (Rust is good too, but maybe a bit too advanced.. feels more like a C++ replacement) The compile time generics is kind of necessary to replace some of the stuff people use C preprocessor macros for. I think Zig is just taking the idea of having compile time evaluation of code to its natural conclusion, and it ends up being a lot cleaner than C with preprocessor magic. The only thing they've added which isn't necessary for a "better C", is the async stuff they're working on now. But I think it's still a good idea.