On self-modifying compilers
And why the second pass is the interesting one.
length18 pages
read≈ 22 min
versionv0.4
figures3
A working draft. Programs that rewrite themselves at compile time are easy to describe and hard to reason about. We try to do both, with small examples, and end up somewhere between a tutorial and a manifesto.
Currently v0.4 — open for comments. The interesting bit isn't the first pass (the program writing itself), it's the second one — when the rewritten program rewrites itself again, and we ask whether the trajectory ever stabilises.