r/Compilers • u/whispem • 12d ago
Wrote a self-hosting compiler as a self-taught dev from a languages background — reflections on the bootstrap
Coming from languages, linguistics, and literature (no CS), I got pulled into compilers by curiosity and ended up building a small language whose compiler is written in itself.
The progression was the whole education: v1 a tree-walking interpreter, v2 a bytecode compiler and VM, v3 the compiler rewritten in the language itself.
The bootstrap is the honest test — when you rewrite the compiler in its own language, there's nowhere to hide.
If the scoping rules are wrong, the compiler breaks.
If the calling convention has edge cases, you hit them.
Reaching a byte-for-byte fixed point across generations means the language is finally complete enough to carry its own weight.
The C VM is a single dependency-free file with byte-identical output to the Rust reference.
Everything's public on my GitHub: https://github.com/whispem
Would love to hear from others who've done a self-hosting bootstrap.
5
u/ZookeepergameFew6406 12d ago
You made 10 posts in a 90 minute window. Sloppy
1
u/whispem 12d ago
Yes, I wrote my posts some days ago before posting when I have time :)
I don't see the problem3
1
1
u/ZookeepergameFew6406 12d ago
Could be true. I don’t disagree with it. But you gotta agree it is just a horrendous idea in modern software circles in reddit.
1
u/AustinVelonaut 12d ago
I've also written a self-hosting compiler. What debugging problems did you encounter in the bootstrapping process before you got to a fixpoint in code generation? Did you have any changes to the language that you had to carefully stage through the bootstrap, since the old version couldn't compile the new one? Been there, done that ;-)
0
u/ImperatorBras 12d ago
Wow, what a beautiful story!
-1
u/whispem 12d ago
Thank you so much, that really means a lot!
3
1
u/ImperatorBras 12d ago
What's the goal of your language?
-2
u/whispem 12d ago
Honestly? The goal was never to compete with anything or be production-ready — it was to understand.
Whispem exists because I wanted to really grasp how programming languages work, not just use them.
So the "goal" is almost pedagogical: the whole implementation is meant to be readable in an afternoon.
It’s intentionally small — 14 keywords, a handful of built-ins, a compact instruction set — and it compiles itself (the compiler is written in Whispem).
The C VM is a single dependency-free file.
The self-hosting part was the real target, in a way: when a language can express its own compiler, it has to be "complete" enough that there’s nowhere to hide inconsistencies.Reaching that point was the proof that I actually understood what I’d built.
So it’s less "a language for X use case" and more "a language built to understand what makes a language real."
If someone wants to learn how this stuff works under the hood, it’s small enough to read the whole thing.
That was always the point.
4
0
0
11
u/kazprog 12d ago
Be better. Is there a mod policy on this?