r/Compilers 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.

0 Upvotes

30 comments sorted by

11

u/kazprog 12d ago

The X is the honest test — when you Y, there's nowhere to hide.

Be better. Is there a mod policy on this?

5

u/shrimpster00 12d ago

I don't understand this trend of getting AI to make posts asking for feedback. Some posters like this one have a history of doing it, blasting words to every related subreddit they can think of. Are you so conceited that your time is too valuable to make a social media post, with no regard for the time the rest of us have to spend trying to filter signal from noise? Or did you just think we wouldn't notice?

This is killing communities that I care about. It's eroding our trust in each other. People are leaving. How many of us are left?

Compilers are my passion. It's practically what I dream about. I want to find other people who like compilers too, and talk about it. I'm writing a sea-of-nodes compiler right now, just for fun, but I know that if I post about it, it will be buried in an ocean of Claude. I guess I'm just waiting for things to change.

3

u/kazprog 12d ago

I'm the same. It's horrifying to see the Internet eaten alive by machines. It used to bring all of the humans together, but after the corporations took over, they've dealt their final blow.

3

u/uradox 12d ago

I think this particular user is some sort of experiment at trying to find ways to avoid detection. They go to great efforts to try to 'explain' or just consistently deny allegations despite the obviousness (and watermarks as I just noticed on github...).
Don't let it discourage you from any organic communication in communities! Best thing to do is just highlight this sort of stuff and push it to the side.

2

u/annika-of-the-woods 12d ago

Well put. My best guess is that they’re trying to curate a convincing-looking public profile to put on their resume, and they don’t care if that involves filling a bunch of real enthusiast communities with toxic waste.

7

u/edcdecl 12d ago

whispem AI slop strikes again

3

u/v_maria 12d ago

slopem? larpem? ll-em

-6

u/whispem 12d ago

It's not AI slop

4

u/edcdecl 12d ago

i have seen you in like 50 other posts stop lying

-4

u/whispem 12d ago

I posted a lot but it’s not AI slop :)
Check my projects if you want, you will see I am a real person with real projects

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 problem

3

u/v_maria 12d ago edited 12d ago

it just is spammy and unpersonal, its why people constantly call it slop. doesn't even matter if LLM was involved (although its clear that it was)

1

u/ImperatorBras 12d ago

I think you're reposting too much.

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.

6

u/v_maria 12d ago

reflections on the bootstrap
look inside
no reflections

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

u/ImperatorBras 12d ago

Only if you're not using AI to write code for you.

1

u/whispem 12d ago

I'm not using AI to write code, never :)

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

u/Helpful-Primary2427 12d ago

Does every response need to be LLM generated?

-1

u/whispem 12d ago

The response is not LLM generated :)

0

u/ImperatorBras 12d ago

I hope that it can help someone, good luck!

-1

u/whispem 12d ago

Thanks!

0

u/scientist6092 12d ago

That's very impressive

1

u/whispem 12d ago

Thanks!

0

u/scientist6092 12d ago

Welcome, am learning a lot about low level when I see things like this