Writing a C Compiler, in Zig (2025)
1–10 of 74 posts
Re: Writing a C Compiler, in Zig (2025)
#2Longer term it also makes me wonder whether something like this could eventually reduce reliance on Clang/LLVM for the C frontend in zig's toolchain.
Re: Writing a C Compiler, in Zig (2025)
#3[1] https://github.com/asibahi/paella/blob/main/writeup/c19.md#u...
Re: Writing a C Compiler, in Zig (2025)
#4Still a proper programmer-flex to build another one.
Re: Writing a C Compiler, in Zig (2025)
#5Looking at the repo, the author seemed a little fed up [1] with the nature of lower level language and quitted. [1] https://github.com/asibahi/paella/blob/main/writeup/c19.md#u...
Re: Writing a C Compiler, in Zig (2025)
#6I thought Zig has a C compiler built in? Or is it just the Zig build system that's able to compile C, but uses an external compiler for that? Still a proper programmer-flex to build another one.
There is also another C compiler written in Zig, Aro[1], which seems to be much more complete than TFA. Zig started using that as a library for its TranslateC functionality (for translating C headers into Zig, not whole programs) in 0.16.
Re: Writing a C Compiler, in Zig (2025)
#7Cool project. Feels like writing a C compiler in Zig aligns nicely with the old "maintain it in Zig" idea that was part of Zig's early value proposition. Is that still considered a relevant goal today? Longer term it also makes me wonder whether something like this could eventually reduce reliance on Clang/LLVM for the C frontend in zig's toolchain.
Re: Writing a C Compiler, in Zig (2025)
#8Looking at the repo, the author seemed a little fed up [1] with the nature of lower level language and quitted. [1] https://github.com/asibahi/paella/blob/main/writeup/c19.md#u...
Feels like maybe something lost in translation with their explanation - they say they were fed up of data structures etc. but they returned to Rust? I’m assuming there’s something a bit more nuanced about what they got tired of with Zig
Re: Writing a C Compiler, in Zig (2025)
#9Earlier quoted context omitted.
Feels like maybe something lost in translation with their explanation - they say they were fed up of data structures etc. but they returned to Rust? I’m assuming there’s something a bit more nuanced about what they got tired of with Zig
I think Rust is "higher level" than C or Zig in the sense that there are most abstractions than C or Zig. Its not Javascript, but it is possible to program Rust without worrying too much about low level concerns.
Re: Writing a C Compiler, in Zig (2025)
#10Looking at the repo, the author seemed a little fed up [1] with the nature of lower level language and quitted. [1] https://github.com/asibahi/paella/blob/main/writeup/c19.md#u...
Feels like maybe something lost in translation with their explanation - they say they were fed up of data structures etc. but they returned to Rust? I’m assuming there’s something a bit more nuanced about what they got tired of with Zig