6 ms·
How so? (If you're hearing a combative tone, it's unintended; I'm asking seriously, because I would love for this to be true!)
by sramsay 2y ago
How so?
(If you're hearing a combative tone, it's unintended; I'm asking seriously, because I would love for this to be true!)
- rc00 2y agoIn 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.
- throwawaymaths 2y agono combative tone detected. for example if two c libs declare a function with the same name youre not gonna have a good time using them both from c. I believe that's not a problem in zig.