3 ms·
The Zig implementation is 3x the C++ implementation? That is surprising.
by spullara 4y ago
The Zig implementation is 3x the C++ implementation? That is surprising.
- cosmic_quanta 4y agoI imagine it has more features. Maybe more optimizations, for example.
- civopsec 4y agoApparently it is just used to build the main compiler from source, so perhaps less featureful.
- acdha 4y agoI wouldn't be surprised if it had some more advanced optimizations or similar things which don't affect compatibility but also note there's one trailing clause in the description: “plus sharing Zig code with the new one”. I'd be curious exactly how much code could be reused across the two like that — it doesn't seem like it should be _that_ much because they were trying to do this to avoid commonly needing to implement things in two places.
- nektro 4y agothere was a lot of code shared between the implementations
- AndyKelley 4y agoFeatures that the new compiler has which the C++ implementation lacked: * The ability to translate C code into Zig * A caching system * A Mach-O linker, ELF linker, COFF linker, and WebAssembly linker * Logic to build musl libc, mingw-w64 libc, and (dynamic) glibc from source, as well as libunwind, libc++, libc++abi * Liveness analysis * A documentation generation system (Autodoc) * An x86_64 backend, aarch64 backend, WebAssembly backend, RISCV-64 backend, arm backend, SPIR-V backend, and C backend
- cryptonector 4y agoWhere would I read more about Zig? Not that I have cycles to spare, but I think a fair bit about moving from C. For example, I maintain an ASN.1 compiler written in C, and I hate C, so I made it emit a JSON AST of ASN.1 modules, and now a friend of mine just wrote a backend in Swift that takes that JSON AST output and produces Swift code / templates. Leaving C behind requires a good path for porting legacy C to the new thing, or else tons of time and mindshare to get new things built. So D and Zig are very appealing.
- badpun 4y agoHey Andrew, Given that one of the most often repeated complainst is the lack of operator overloading, which makes any kind of vector math (so, all graphics programming, and many other things) very ugly, would you re-consider adding it to the language?