News for hackers. Stuff that matters.
Re:Show HN: Onramp Can Compile Doom by Koshkin on Tuesday December 31, 2024 @05:13PM (#42562242)
They do go into some detail of the steps involved. Basically, it seems as though the system unravels itself, going from simple things to more complex.
Re:Show HN: Onramp Can Compile Doom by binarymax on Tuesday December 31, 2024 @05:34PM (#42562360)
Thanks, but perhaps I should have been more clear in my question. How can something self-compile if it doesn't have a compiler to start with? Does the onramp source contain some machine code that is a compiler already?
Re:Show HN: Onramp Can Compile Doom by prizzom on Tuesday December 31, 2024 @06:23PM (#42562626)
I think the missing piece here is that onramp contains the definition of a very simple virtual machine. One that the reader could implement themselves (though a reference implementation is also provided).

After it incrementally builds on itself all the way up to a fully functional C compiler.

Re:Show HN: Onramp Can Compile Doom by Koshkin on Tuesday December 31, 2024 @05:46PM (#42562426)
Indeed it does! It all starts with a hexadecimal code which is converted by a tool into the machine code for some simple VM; there seem to be a few more steps, where one thing is used to build another, etc. It is in this sense that this particular system is said to be able to “compile itself.”