ilusm.dev
Self-Hosting

Self-Hosting

How ilusm implements itself: the compiler and VM are written in ilusm.

What self-hosting means

A language is self-hosted when its own compiler and runtime are written in itself. The lexer, parser, compiler, encoder, and VM are all written in .ilu files under lib/.

Compile pipeline

The full pipeline, all in .ilu files:

Source (.ilu)
  │
  ▼
lib/frontend/lex.ilu          # Lexer: source text → token stream
  │
  ▼
lib/frontend/prs.ilu          # Parser: token stream → AST
  │
  ▼
lib/backend/compiler.ilu      # Compiler: AST → instruction list
  │
  ▼
lib/backend/mcde.ilu          # Encoder: instruction list → ILBC binary
  │
  ▼
ilusm.ilbc                    # Compiled bytecode artifact

The compile pipeline is orchestrated by lib/backend/compile_pipeline.ilu. The resulting ilusm.ilbc file ships with the language.