Skip to content

self-host P0: MVP compiler core in t27, byte-identical to gen-c, fixpoint on its own source #5981

Closed

Description

@gHashTag

Part of #5980 (P0).

Scope

A t27 module specs/compiler/core/t27core.t27 that is a compiler: it reads t27 source from a byte buffer, lexes, parses, and writes C to an output buffer.

  • Written only in the subset t27c gen-c handles today (global arrays/scalars, scalar fns, while/if/else if/break/continue/return, casts, char literals, and/or, bit ops, shifts). No structs, no strings -- parallel arrays.
  • Accepts the same subset it is written in, and rejects everything else with a nonzero result, including the gen-c defect shapes listed in epic: self-host t27c -- rewrite the compiler from Rust into t27 #5980.
  • Pure core: compile(len) -> out_len. stdin/stdout live in a ~20-line C driver held by the test harness (plumbing, not part of the language).

Acceptance

  • core(fixture) == t27c gen-c(fixture) byte for byte, for every fixture.
  • Fixpoint: core(t27core.t27) == t27c gen-c(t27core.t27).
  • The generated C of the core passes the core's own test blocks (-DT27_TEST_MAIN).
  • Gated by bootstrap/tests/core_selfhost.rs.

Boundary

  • specs/compiler/core/t27core.t27
  • bootstrap/tests/core_selfhost.rs

Activity

  1. added
    needs-boundaryNo '## Boundary' section, so the Queen can reserve nothing for it and no bee can take it
    and removed
    needs-boundaryNo '## Boundary' section, so the Queen can reserve nothing for it and no bee can take it
    on Oct 4, 2026
  2. gHashTag commented on Oct 4, 2026

    @gHashTag
    OwnerAuthor

    Implemented in #6041 -- fixpoint holds (core(t27core.t27) == gen-c(t27core.t27)), 58 corpus specs byte-identical, gated by bootstrap/tests/core_selfhost.rs.

  3. gHashTag commented on Oct 4, 2026

    @gHashTag
    OwnerAuthor

    This is already done: #6041 (specs/compiler/core/t27core.t27 + bootstrap/tests/core_selfhost.rs, fixpoint with gen-c) merged to master as 1953c75. A bee now on this issue should stop and open no PR; the next work for epic #5980 is the gen-c defects #6046-#6052.

  4. added 2 commits that reference this issue on Oct 4, 2026
    df32355
    b751ee2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions