Skip to content

self-host P3 slice 5: L3 and L4 as t27c runs them, and as the constitution states them under strict_laws (E_LAW) #8103

Closed

Description

@gHashTag

Part of #5980 (phase P3: "the semantic passes t27c runs before codegen (name resolution, type inference, L3/L4 checks)"). This is the fifth and last P3 slice: L3 and L4.

Before codegen, t27c checks L3 (ASCII source) only in its lexer, which refuses a non-ASCII identifier. It does not check L4 (a test, an invariant or a bench) at all. t27c test-report counts untested specs, but it generates them. The constitution says L3 covers comments too and that L4 is enforced by the parser (see #8101).

This slice

  • By default the core does what t27c does: a non-ASCII name is E_LEX (since P1), and it takes a non-ASCII comment and an untested module, byte-identical with gen-c.

  • With strict_laws set, compile also refuses with the new code E_LAW (18):

    • any byte past ASCII, a comment's too (L3);
    • a module with no test, invariant or bench (L4).

    A gate can then enforce the laws without the Rust compiler. The core's own source passes both.

  • Core tests for both modes; t27core_ddc.t27 restates strict_laws and is repinned.

The switch is off by default because about 497 of the 1703 specs carry non-ASCII comments and about 134 have no test, invariant or bench, as #8101 records. The core's own tests also compile untested snippets.

Boundary

  • specs/compiler/core/t27core_ddc.t27

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 9, 2026
  2. added a commit that references this issue on Oct 9, 2026
    afc601f
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions