3 ms·
Every time I read about Zig, I feel like I see a nice language that's only an incremental improvement to C mostly in terms of ergonomics. It's hard for me to im
by richardanaya 5y ago
Every time I read about Zig, I feel like I see a nice language that's only an incremental improvement to C mostly in terms of ergonomics. It's hard for me to imagine people giving up C for only incremental gain.
- defen 5y agoAn alternative perspective is that you don't have to give up C to use Zig - they are extraordinarily easy to mix together in one project. So you can incrementally move an existing project to Zig without rewriting the world.
- naasking 5y agoCompile type computations, trivial cross-platform building and linking, vastly better error handling, and more. Honestly, I'm having a hard time seeing how these are only "incremental" improvements over C.
- sharikone 5y agoYou could argue the opposite and say that because it is incremental and easy to mix with C, it will be more easily used. When I program on my own I often write an idea in C and then convert it to C++ when complexity rises, precisely because C++, in terms of syntax, is an incremental update to C. Using say Rust would entail a more serious rewrite. Unfortunately Zig and Rust are quite different in syntax. I would love to change my workflow from C->C++ to Zig->Rust but the transition is not as nice.
- flohofwoe 5y agoI thought that too in the beginning, but the comptime features, type reflection and error handling really go beyond C, while still being a simple and elegant language (in a way even simpler than C). Also Zig is a nicer C/C++/ObjC toolchain than most C/C++ toolchains (because of simple cross-compilation and integrated build system).
- hansvm 5y agoI don't know how many people will switch, but I think it's worth it for even a few of the new features. - You can get cross-compilation for free in Cython projects just by switching compilers. - (nearly) Arbitrary width integer types are a godsend for the right kinds of bit twiddly projects. - The error handling is actually really nice.