● M5 complete — and with it, all six milestones. Final just ci is green, just diff-test matches the oracle. #3

Merged
navicore merged 1 commit from M5 into main 2026-06-04 21:43:12 +00:00
Owner

M5 summary

Binary size: 4.4M → 676K. The surprise: the DWARF wasn't coming from -g at all — it rides in from the runtime
archive's object files (Rust std debug info), and the linker copies it unless told otherwise. Release links now
pass -Wl,--strip-debug; --debug builds keep DWARF + -O0. That puts plgc binaries under the patch-seq 730K bar.

Guarded, not just measured: new tests/binary_size.rs in just ci — a 1.3M size ceiling (catches a lost linker
flag or runtime bloat) and an ldd check enforcing the standalone contract: nothing beyond
libc/libm/libgcc/loader, ever.

Script mode: #!/usr/bin/env plgc works end-to-end — ./greet.pl --query "greet(X,Y)" compiles to a temp binary
and execs it. The parser blanks a leading #! line, preserving error line numbers.

Docs trued up: COMPILATION_MODEL.md now honestly states what's inline (dispatch switches, control flow,
constants) vs. runtime calls (head unify, arithmetic eval) with inlining as the named escape hatch; README
rewritten with real numbers; footprint recorded in the ROADMAP.

The project, end to end

┌────────────────┬─────────────────────────┬───────────────────────────────────────────────────────────────┐
│ │ patch-prolog (v1) │ patch-prolog2 │
├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
│ "Compile" │ scaffolds cargo │ LLVM IR → clang, needs nothing but clang │
│ │ project, needs Rust │ │
├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
│ Execution │ tree-walking │ native code, choice points, musttail TCO │
│ │ interpreter, always │ │
├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
│ 5k-chain query │ ~10s │ 3ms (first-arg indexing) │
├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
│ hello-world │ n/a (cargo-built │ 676K, libc/libm only │
│ binary │ interpreter) │ │
├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
│ Semantics │ the spec │ byte-parity (200-assertion ported corpus + 57-goal diff │
│ │ │ harness), ISO where v1 had bugs — each documented │
└────────────────┴─────────────────────────┴───────────────────────────────────────────────────────────────┘

Test totals: 123 runtime + 48 frontend + 54 shared/compiler unit, 89 ported v1-corpus, 14 M3-suite, 14
integration, 12 golden-IR, 2 binary-hygiene, 1 differential — all green in ~12s of CI test time.

What's deliberately left on the table (ROADMAP "Future"): REPL/LSP (v1 had them; they'd drive the same compiled
runtime now), WAM-level codegen and inline fast paths if performance ever demands, copying GC, bagof/setof. The
reserved_builtin machinery is gone entirely — the language surface is exactly v1's, compiled.

M5 summary Binary size: 4.4M → 676K. The surprise: the DWARF wasn't coming from -g at all — it rides in from the runtime archive's object files (Rust std debug info), and the linker copies it unless told otherwise. Release links now pass -Wl,--strip-debug; --debug builds keep DWARF + -O0. That puts plgc binaries under the patch-seq 730K bar. Guarded, not just measured: new tests/binary_size.rs in just ci — a 1.3M size ceiling (catches a lost linker flag or runtime bloat) and an ldd check enforcing the standalone contract: nothing beyond libc/libm/libgcc/loader, ever. Script mode: #!/usr/bin/env plgc works end-to-end — ./greet.pl --query "greet(X,Y)" compiles to a temp binary and execs it. The parser blanks a leading #! line, preserving error line numbers. Docs trued up: COMPILATION_MODEL.md now honestly states what's inline (dispatch switches, control flow, constants) vs. runtime calls (head unify, arithmetic eval) with inlining as the named escape hatch; README rewritten with real numbers; footprint recorded in the ROADMAP. The project, end to end ┌────────────────┬─────────────────────────┬───────────────────────────────────────────────────────────────┐ │ │ patch-prolog (v1) │ patch-prolog2 │ ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤ │ "Compile" │ scaffolds cargo │ LLVM IR → clang, needs nothing but clang │ │ │ project, needs Rust │ │ ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤ │ Execution │ tree-walking │ native code, choice points, musttail TCO │ │ │ interpreter, always │ │ ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤ │ 5k-chain query │ ~10s │ 3ms (first-arg indexing) │ ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤ │ hello-world │ n/a (cargo-built │ 676K, libc/libm only │ │ binary │ interpreter) │ │ ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤ │ Semantics │ the spec │ byte-parity (200-assertion ported corpus + 57-goal diff │ │ │ │ harness), ISO where v1 had bugs — each documented │ └────────────────┴─────────────────────────┴───────────────────────────────────────────────────────────────┘ Test totals: 123 runtime + 48 frontend + 54 shared/compiler unit, 89 ported v1-corpus, 14 M3-suite, 14 integration, 12 golden-IR, 2 binary-hygiene, 1 differential — all green in ~12s of CI test time. What's deliberately left on the table (ROADMAP "Future"): REPL/LSP (v1 had them; they'd drive the same compiled runtime now), WAM-level codegen and inline fast paths if performance ever demands, copying GC, bagof/setof. The reserved_builtin machinery is gone entirely — the language surface is exactly v1's, compiled.
● M5 complete — and with it, all six milestones. Final just ci is green, just diff-test matches the oracle.
All checks were successful
CI - Linux / CI - Linux x86_64 (pull_request) Successful in 47s
f98881bd58
M5 summary

  Binary size: 4.4M → 676K. The surprise: the DWARF wasn't coming from -g at all — it rides in from the runtime
  archive's object files (Rust std debug info), and the linker copies it unless told otherwise. Release links now
  pass -Wl,--strip-debug; --debug builds keep DWARF + -O0. That puts plgc binaries under the patch-seq 730K bar.

  Guarded, not just measured: new tests/binary_size.rs in just ci — a 1.3M size ceiling (catches a lost linker
  flag or runtime bloat) and an ldd check enforcing the standalone contract: nothing beyond
  libc/libm/libgcc/loader, ever.

  Script mode: #!/usr/bin/env plgc works end-to-end — ./greet.pl --query "greet(X,Y)" compiles to a temp binary
  and execs it. The parser blanks a leading #! line, preserving error line numbers.

  Docs trued up: COMPILATION_MODEL.md now honestly states what's inline (dispatch switches, control flow,
  constants) vs. runtime calls (head unify, arithmetic eval) with inlining as the named escape hatch; README
  rewritten with real numbers; footprint recorded in the ROADMAP.

  The project, end to end

  ┌────────────────┬─────────────────────────┬───────────────────────────────────────────────────────────────┐
  │                │    patch-prolog (v1)    │                         patch-prolog2                         │
  ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
  │ "Compile"      │ scaffolds cargo         │ LLVM IR → clang, needs nothing but clang                      │
  │                │ project, needs Rust     │                                                               │
  ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
  │ Execution      │ tree-walking            │ native code, choice points, musttail TCO                      │
  │                │ interpreter, always     │                                                               │
  ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
  │ 5k-chain query │ ~10s                    │ 3ms (first-arg indexing)                                      │
  ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
  │ hello-world    │ n/a (cargo-built        │ 676K, libc/libm only                                          │
  │ binary         │ interpreter)            │                                                               │
  ├────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────┤
  │ Semantics      │ the spec                │ byte-parity (200-assertion ported corpus + 57-goal diff       │
  │                │                         │ harness), ISO where v1 had bugs — each documented             │
  └────────────────┴─────────────────────────┴───────────────────────────────────────────────────────────────┘

  Test totals: 123 runtime + 48 frontend + 54 shared/compiler unit, 89 ported v1-corpus, 14 M3-suite, 14
  integration, 12 golden-IR, 2 binary-hygiene, 1 differential — all green in ~12s of CI test time.

  What's deliberately left on the table (ROADMAP "Future"): REPL/LSP (v1 had them; they'd drive the same compiled
  runtime now), WAM-level codegen and inline fast paths if performance ever demands, copying GC, bagof/setof. The
  reserved_builtin machinery is gone entirely — the language surface is exactly v1's, compiled.
navicore referenced this pull request from a commit 2026-06-18 18:09:27 +00:00
navicore referenced this pull request from a commit 2026-06-20 22:03:21 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
navicore/patch-prolog!3
No description provided.