|
|
|
|
|
by kragen
5778 days ago
|
|
The chicken-and-egg problem can take a certain amount of effort to solve, but it's not a major engineering obstacle. The easiest way to bootstrap a self-compiling compiler from bare metal is probably by writing a Forth inner interpreter in machine code, which is a few hundred bytes; a Forth outer interpreter in threaded code, which is a few hundred cells; and then an interpreter for the language of your compiler in Forth, which is likely to be a few dozen to a few thousand lines of code, depending on the language. (I don't know if Forth is good for anything else, but it's optimal for this.) I don't know how to estimate this task properly, but I doubt it's more than a few weeks of work for a skilled person. |
|