5 ms·
C?
by dottedmag 5y ago
C?
- viraptor 5y agoYou'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.
- coder543 5y agoA lot of popular C compilers are actually written (at least partially) in C++ these days.
- dottedmag 5y agoIn this case, C++?
- kaba0 5y agohttps://guix.gnu.org/manual/en/html_node/Preparing-to-Use-the-Bootstrap-Binaries.html https://guix.gnu.org/manual/en/html_node/Preparing-to-Use-th... The Guix project likes bootstrappility very much. They basically host a tiny assembly C-compiler (only for a subset of C) which can compile a C compiler written in C for the whole subset that can bootstrap the whole ecosystem.
- dottedmag 4y agoThis link is better: https://savannah.nongnu.org/projects/stage0 https://savannah.nongnu.org/projects/stage0: bits to asm to C, and then everything else follows.