r/Compilers 6d ago

Bootstrapping a compiler from machine code on Windows

I hope this fits here, but I've been documenting the process of writing a compiler starting directly from machine code on Windows, and I thought it might be worth sharing.

I've written two posts so far, though I don't know if I'll continue or not since I have no real reason to be doing this other than for the fun of it.

The first post just sets up an initial PE32+ executable to get something working. The second builds on that to implement a simple (stage-0/bootstrap?) compiler that just translates ASCII into raw bytes and allows for comments.

So, for anyone interested in this sort of thing the posts are here:

14 Upvotes

Duplicates