boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

cc — C compiler in scheme1

A single-file C compiler written in scheme1 (see docs/SCHEME1.md) that emits P1pp text, replacing MesCC at the live-bootstrap tcc-mes stage.

Specs

Read in this order:

  1. docs/CC.md — accepted C subset.
  2. docs/CCSCM.mdcc.scm code map: subsystems, data structures, pipeline.
  3. docs/CC-EXT.md — platform extensions accepted beyond the base subset (the deltas tcc-0.9.26 actually uses).

Files

File Purpose
cc.scm All compiler modules in one file: util, data, lex, pp, cg, parse, and the cc-main driver. Sections are still labeled with their original ;; cc/<name>.scm — headers.
main.scm One-liner production entry point: (sys-exit (cc-main (argv))). Tests omit it so they can run their own drivers.

Build (single source for scheme1):

catm  build/$ARCH/cc/cc.scm \
      scheme1/prelude.scm cc/cc.scm cc/main.scm

Tests

Both cc-cg and cc are runtime-validating: the harness builds the emitted P1pp into a real ELF, runs it, and asserts exit code / stdout. No P1pp-text goldens.