Brian Kernighan on the origins of Unix
Brian Kernighan on the origins of Unix
Posted Jan 29, 2022 15:12 UTC (Sat) by scientes (guest, #83068)Parent article: Brian Kernighan on the origins of Unix
Absolutely. I got really excited about Zig-lang's goals to replace C, while still being Turing complete, but it has IMHO since abandoned that goal.
The features of Zig that could feasibly be ported to C (with a great deal of work) would be--
1. Remove the need of C pre-processor, which is a language of its own (the original Go compiler written in C avoided the C pre-processor, but Zig does it better).
2. Better memory allocation. malloc and free are a commonly slow in C applications, leading to Firefix and Chromium using custom allocators (jmalloc and tcmalloc) but these, and also the quite novel Mesh-allocator are not as good as the Zig abstractions. Also, C programs that use malloc and free are generally at the mercy of the OOM killer, and these type of bugs have plagued systemd due to the incredible bug-hunter Evvrx.
3. Make integer overflow part of the language, instead of obscure "undefined behavior" rules which are often over-ruled by an excessive number of non-standard-behavior compiler switches which are even used by Linux.