Hi!
I have a little interesting bootstrapping-related project to share. I work with a programming language in which the compiler is written in the language it compiles. To make a new compiler binary from the source, I can run something like:
runtime compiler.bin source.txt compiler.bin
As part of the instructions I use to build my tools on new systems, I tend to not use the binary, but instead work from a hex dump, the compiler binary is so small, that a hex dump is nice because it can be versioned, human-readable, sent over between computers safely as text files, not get caught by virus detectors, etc..
But this bring the issue, okay how do I turn a text file into a binary. So normally you’d use xxd, hd, but not all systems have it, and ultimately, you have this extra dependency.
FAFAFXFZFwfaalFBFAAFFZFZXVGfoAAFXFZFFXXfoKgaam&/$AAAFXJgaam&/AFAAFXFFZZDYJF$/FXAKF|Bgaam/AAFXFZFXgBFAYXFEF|BGGoGAFAFXFZDYFEF|B/DAAFX_gBAGYgDAAFXFXAXZEEZXGPgBAAFXFFZZ_]GQFAPGA^GAQFAPgaamFPGAAFXFXFFXXW
This long string above, is equal to valid program that can be run, so there is no binary file seed needed to bootstrap the ecosystem! In this particular case, it just so happens that there is a bytecode program where every byte is a valid visible ascii character. Finding that program was done by @dzoe(not me).
Extra: Numbers Out Of The Void
The runtime has the quirk that stacks are circular, there are no overflow/underflow states, removing an item from an empty stack only moves the pointer to 0xff. On boot, the memory is zeroed, so there’s a pool of zeroes just beyond the horizon of the top of the stack. This allows a program to do away with using literals altogether and spawn numbers from the void.
This might look utterly cursed but it is the only way to create integers that will not get make invalid ascii characters:
1, is 0 + 11<<, is DUP ADD- etc
1+ 2<< 1<< 1+ 1<< SWP 1+ 1<< 1+ 2<< 1+ 2<< ( 0x1234 )