Tags v3-fixpoint, v3-bootstrap, v3-selfhosting.
Suite 111/111.
m2compiler-V3 now compiles its own complete source set with
itself, reproducing its image byte for byte:
bootstrap/fixpoint.sh
Stage 1 gm2 -fiso builds V3 (CR -m) -> m2s1
Stage 2 m2s1 compiles SymTab QbeGen M2S M2P M2 -> stage2.ssa -> m2s2
Stage 3 m2s2 compiles the same set -> stage3.ssa
cmp -> FIXPOINT OK
(1,991,439 bytes)
The compiler no longer needs GNU Modula-2 except as a one-time seed for Stage 1; Stage 2 onward is V3 all the way down.
src/M2.atg → M2S scanner, M2P
parser, M2 driver).SymTab) + QBE backend (QbeGen) → SSA text.qbe → cc (with runtime/syslib/shim.c).Language: scalars, composites (arrays/records/sets/pointers), control
flow, procedures (value/VAR/open/nested + static links/FORWARD),
separate compilation (DEFINITION/IMPLEMENTATION, IMPORT, opaque),
64-bit ints, ADDRESS/ADR/SIZE, procedure types + indirect calls,
Wirth-style nested modules, short-circuit AND/OR, BITSET, typed
set constructors, HALT, and GNU-compatible literals (0x, octal
char, LENGTH/ORDL/CAP, &/~).
Runtime/ABI: NUL-terminated CHAR arrays (terminator slot at index =
count), inline record array fields, heap/stack descriptor initialisation
(nested arrays included), string lib (Strings), FileIO (host for
Stage 1; self-hosted runtime/syslib/FileIO for Stage 2+), C shim.
cd /home/eric/Projets/Projets-Modula2/MyWork/m2compiler-V3
./bootstrap/fixpoint.sh # FIXPOINT OK
cd compiler && ./build.sh && ./run_tests.sh # 111/111
No generics/interfaces, no ARC/exceptions, QBE backend is terminal (no
native codegen), Linux only, and some GNU/classic conveniences accepted
for self-hosting. SYSTEM facilities are built-ins, not an importable
module.
FileIO selection explicit; M2make-driven builds.docs/plan.md (UCHAR/
UString).