3 ms·
In C, C imports are in the global namespace. The language is also compiled sequentially, so often, time is spent ensuring headers are included in the proper ord
by rc00 2y ago
In C, C imports are in the global namespace. The language is also compiled sequentially, so often, time is spent ensuring headers are included in the proper order, hopefully avoiding a cyclic dependency. In Zig, C imports are done in a struct with a local namespace or imported package definition and the ordering is not relevant to compilation.
I think parent means that Zig is a better language with regards to being the target for C to be imported into than C and that is the benefit of being a more modern language with flexibility following more modern conventions. This is combined with the mostly seamless ability to utilize most C functions and types without too much strife.
- throwawaymaths 2y agoease of cross compilation as well.