I wrote a small C compiler called wcc! It’s not much at the moment, but it’s capable of compiling a small hello world program and I think it’s already super neat :) I attached the generated assembly (which can be compiled with FASM and linked with the c standard library) because I think the generated code is very interesting. The IR is stack-based which makes the output have a lot of pops and pushes.

In the future I plan on making it fully self-hosting which will be super exciting! Then I want to add a new frontend for my own syntax and a slightly different language with slightly different features (I have plans but nothing concrete now, except that I like the name ozone). I also want to write multiple backends and specifically intend on writing a backend for the uxn system, which will hopefully be self-hosting on there too :) If I can successfully compile the compiler to uxn, it will be the first C compiler to run on the uxn/varvara virtual machine! I also intend on adding some more normal backends, with the most interesting to me being the 6502 CPU, WASM, and LLVM.

(read more on my blog)