A Compiler Writing Journey

https://github.com/DoctorWkt/acwj

Comments

parallax_errorMar 25, 2026, 3:21 AM
Very cool! I can’t imagine writing everything in C, I’m currently learning this in OCaml which seems nicer for a project like this.
MisterTeaMar 25, 2026, 4:01 PM
> I can’t imagine writing everything in C

I will say that C is a perfect low level language for bootstrapping more complex systems and languages. If I were building a bootstrap compiler I would write it in C and have it emit C. Specifically C89/99 ONLY with no POSIX/GNU deps. that will guarantee a large swath of compiler and system support out of the box.

anta40Mar 25, 2026, 9:07 AM
nurettinMar 25, 2026, 5:07 AM
Wow that's super nostalgic. You're on a great path! After doing something similar, I switched to Haskell. Give it a go if you have the time.
pjmlpMar 25, 2026, 8:11 AM
Having it all in C brings back memories from "Compiler Design in C" a famous book for its time, printed in 1990.

https://holub.com/compiler/

nils-m-holmMar 25, 2026, 9:03 AM
I wrote a book in its spirit in 2012 with a second edition in 2022: http://t3x.org/reload/

It is called Practical Compiler Construction. The Compiler Writing Journey is based on it.

krecoMar 25, 2026, 11:24 AM
Thanks for your amazing work!
mzsMar 25, 2026, 2:47 PM
"Part 64: Self-compilation on an 8-bit CPU"

Unlike how a bunch of projects end right as they start to get good, this has a great ending. Thank you

cxrMar 25, 2026, 3:01 PM
(2020)

Previously:

12 comments; 156 points. 2022 November 29. <https://news.ycombinator.com/item?id=33788013>

67 comments; 484 points. 2020 January 8. <https://news.ycombinator.com/item?id=21968420>

skyfantomMar 25, 2026, 1:40 PM
This hopefully can be useful as well https://space4links.com/r/writing-a-compiler
Muhammad523Mar 25, 2026, 2:27 PM
I feel like interpreters and compilers were trendy in 2015/2016, bu i'm too young to know. Am i right?
maniacsudipMar 25, 2026, 7:19 AM
[dead]
maltyxxxMar 25, 2026, 11:46 AM
[flagged]
brcmthrowawayMar 25, 2026, 3:26 AM
How much of Claude was used?
azhenleyMar 25, 2026, 3:32 AM
It was started 7 years ago.
Muhammad523Mar 25, 2026, 2:26 PM
Why must there always be a random guy on HN randomly mentioning Claude?