This compiler is a derivative of SML/NJ, a research compiler built collaboratively by Bell Labs, CMU, Yale, Cornell and Princeton, among others. (A good overview of its internals is contained in [13].)
The compiler proper is the part of Mythryl responsible for converting a single source file into native object code.
(See src/app/makelib for the higher-level task of compiling all the components of an application in the correct order and producing an executable binary for the application as a whole.)
The compiler is conceptually organized into two parts:
The back end in turn is subdivided into two parts:
The basic compiler code layout is:
The actual top-level compilation code is in makelib, src/app/makelib/main/makelib-g.pkg
This is where commandline switches to the compiler are processed. This file is however mostly concerned with "make" level functionality (traversing the source-file dependency graph and compiling individual files in topologically correct ordering) rather than compilation per se.
From a control flow point of view, the top of the core interactive compile function-call hiearchy is the c::compile call in
src/lib/compiler/toplevel/interact/read-eval-print-loop-g.pkg.
together with nearby code, while the core makefile-driven compilation code is in
src/app/makelib/main/makelib-g.pkg.
which delegates most of the work to
src/app/makelib/compile/link-in-dependency-order-g.pkg.
and (especially) the compile_in_this_process function in
src/app/makelib/compile/compile-in-dependency-order-g.pkg.
Either way, the actual heart of the compile-one-file logic is in
src/lib/compiler/toplevel/main/translate-raw-syntax-to-execode-g.pkg.