Skip to content

docs: compiler-extension contributor runbook (developer depth gap) #653

Description

@hyperpolymath

Audience

Developers hacking the compiler internals (OCaml lexer/parser/typechecker/borrow-checker/codegen/effects + the formal/ Coq track).

Gap

Surfaced by the 2026-06-21 docs-depth gap-assessment. wiki/compiler/* documents each phase (lexer, parser, type-checker, borrow-checker, codegen) and there's a pipeline diagram in wiki/compiler/architecture.md, but there is no task-oriented runbook for the common contributor flows. A new contributor knows what each phase is but not how to change one. Specifically missing:

  • "Extend the grammar / add a syntactic form" end-to-end walkthrough.
  • "Add a typecheck or borrow-check rule" — lib/borrow.ml's algorithm is described only in prose in docs/CAPABILITY-MATRIX.adoc; no walkthrough or debugging tips.
  • "Add/extend a codegen target" checklist.
  • "Run & extend the formal/ Coq proofs locally" — formal/justfile exists but is undocumented; no "how to Print Assumptions / check no-Admitted" steps, and no narrative tying K‑1→F‑1→P‑2… to the code a contributor actually edits.

Suggested scope

  • docs/architecture/EXTENDING-THE-COMPILER.adoc (.adoc per DOC-FORMAT), or a wiki/compiler/extending.md companion, containing:
    • a "which file for which change" touch-map,
    • a worked "add a new keyword, end-to-end (lex → parse → typecheck → codegen → test)" example,
    • typechecker/borrow-checker debugging tips + where the test fixtures live,
    • a formal/ build/check quickstart, with the K‑1→F‑1→P‑2 obligations mapped to the implementation they constrain.

Acceptance

A new contributor can add a trivial syntactic form and run the proof check following only this doc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions