> Hi, > > I would like to learn about how MIT Scheme's compiler works internally, as > a stepping stone towards making a version of it that's buildable without > already having MIT Scheme installed: > https://bootstrappable.org/ > >>From what I understand, the compiler collects all of the procedure >> definitions into a single band file that represents the target compiler's >> behaviour. Then, the rest of the target compiler is built using the >> definitions in the band file. After that, the SCode is converted to >> compiled code objects and linked together. Please correct me if I'm >> wrong. > > There are a few questions I would like to ask: > > 1. How are cyclical definitions handled? > For example, in the runtime: > > mit-syntax.scm (sc-macro-transformer) (classifier->runtime) > -> syntax-low.scm (make-unmapped-macro-reference-trap) > -> reference-trap.scm (primitive-object-set-type) > -> sysmac.scm (define-primitives) > -> mit-syntax.scm (sc-macro-transformer) > > 2. What challenges are there in using a different host Scheme for defining > core semantics? > > 3. Are there parts of MIT Scheme that are especially dependent on MIT > Scheme specific features? > This part is what makes bootstrapping very complex, since the only > solution would be to desugar syntax or reimplement the syntax as macros. > >
I'm surprised nobody has answered this yet, but I suppose it's better late than never ;-) The answer is that MIT-Scheme should already be bootstrappable. There (used to be?) a C backend for LIAR that compiles the sources to C code, and that can be found already pre-packaged here: https://ftp.gnu.org/gnu/mit-scheme/stable.pkg/9.2/mit-scheme-c-9.2.tar.gz The instructions for compiling that are here: https://web.mit.edu/scheme_v9.2/doc/mit-scheme-user/Portable-C-Installation.html Once you compile that C program, you should have enough to start building yourself up to the latest MIT-Scheme. I hope that helps.
