boot2

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

CC codegen punch list

C99-subset codegen capabilities, ordered for red→green TDD per CC-INTERNALS.md §Feature workflow. The accepted language surface is defined in CC.md; this doc is the implementation checklist against that surface.

Conventions

Already green

cc-cg 00–14 + cc 00–14 cover: empty fn, return with const/param, two-param fn, i64 binops, locals + assign, if / if-else, while with break / continue, direct calls (0..5 args, with stack staging), string literal interning, file-scope zero-init globals, &x on a param, typedef plumbing through to a return.

Punch list

A. Width-correct integer codegen

The 64-bit-everything load/store path is the largest correctness gap upstream of nearly everything else. Land this first.

B. Lvalue mechanics

Picked (b) cg-dup — duplicate the top vstack entry, used for compound assign and pre-inc/dec to keep the lhs lval available across its own load. Post-inc/dec use a dedicated cg-postinc / cg-postdec primitive to capture the old rval before the store. See CC-CONTRACTS §4.1.

C. sizeof

D. Aggregates

E. Initializers

parse-init-list (parse.scm lines 398–413) currently balances braces and returns #f, dropping all initializer data. cg-emit-global accepts an init bv but is never given one.

F. Control flow extensions

G. Variadics

H. Conditionals as values

Added cg-ifelse-merge: caller pre-allocates the result slot, each thunk pushes one rval that is then loaded and stored into the slot, and the slot's frame rval is left on the vstack. The merged result type is taken from the first thunk's pushed type — parser is responsible for arranging compatible types in the two branches.

I. Storage classes

J. Driver / envelope

K. Expressions and conversions

L. Aggregates round 2

Phase milestones (CC.md §Validation)

The CC.md milestones gate on contiguous blocks above. Each lights up once its dependencies are green:

The last is the bootstrap milestone — at that point lispcc has fully replaced MesCC in the chain.