Thursday, June 18, 2009

“The night was quiet — too quiet.”

Time to restart posting. I have a bunch of half-finished posts. I think I was trying to write too much in one sitting. I'm going to write smaller things, but I intend to write more frequently.

Big news today: my C# version of MIT Scheme can now self-host. (I would say that it is self-hosting, but I don't want to tempt fate that much.) When I started, I was loading the SCode binaries that were created by the native Windows version of MIT-Scheme (with the runtime written in C). My bootstrap fasloader would translate the binaries into .NET data structures on the fly. Unfortunately, I couldn't create these binaries without the original syntaxer from MIT-Scheme. But I have managed to get the syntaxer to re-generate the binaries. The C# binaries have a completely different format from the original binaries. This is because I simply serialize the data structures into the file using the built-in C# serialization protocol. The fasloader now attempts to load binaries by first attempting to deserialize them, and if that fails, falling back on the bootstrap fasloader that understands the original binary format.

So I have a bootstrap runtime built out of the original binaries. I boot from them, and then use them to create a new set of binaries. I booted from the new set, created a second generation set of binaries, and saved them. Now I can boot from the second generation and create the next generation without needing a native MIT Scheme executable. (Again, in theory. I might have second or third generation bugs waiting to prove me wrong, so I'm not discarding the original code quite yet.)

I'll upload the latest code in a short while.
Post a Comment