|
|
|
|
|
by dbandstra
2016 days ago
|
|
Zig is a lot more complex than C, but I think most of the language complexity came from filling in gaps rather than tacking things on. For example I think they have settled on having no dynamic dispatch feature (interface, trait, virtual method, etc) at the language level. The comptime feature is flexible enough that userland approaches seem to be good enough. I bet a lot of "complexity" in the future will come from competing idioms used in various third party libraries. |
|
I think it's important to keep in mind that with C you might end up using a bunch of extenions, complex pre-processor macros or pragma magic to achieve essential things.
C in itself is relatively simple, but using it in practice can end up becoming quite complex.
Zig ends up being simpler in some ways by having less magic and special ways of achieving things. "printf" is very magical in most C compilers, but the equivalent in Zig is nothing particularly special from either the language or the compilers side.
I think the only thing that truly adds complexity without being strictly necessary, is the async stuff. But you can argue that async IO is becoming a really essential thing for systems programming, and using it without explicit language suppport is a nightmare.