2 ms·
You're commenting on an article about Zig which became self-hosted and can compile C. (There's also lots of other C compilers available)
by viraptor 5y ago
You're commenting on an article about Zig which became self-hosted and can compile C. (There's also lots of other C compilers available)
- dundarious 5y agoZig compiles C/C++ by deferring the vast majority of the work to libclang, which is written in C++. Also note Zig is self-hosted when using the LLVM backend, which means deferring to C++ for much of the code generation. There is no "end-to-end Zig" self-hosted compiler yet, because the Zig native backends are not as near completion. See the creator's comment about the breakdown: https://news.ycombinator.com/item?id=31052234 https://news.ycombinator.com/item?id=31052234. (I'm excited about this progress, so this is not meant as any kind of knock on Zig, which I think is quite impressive) But you're right that C is not a good example.