Skip to content

[SEED-2] Ring-2: Type declarations — enum/struct gen to Zig #5

Closed

Description

@gHashTag

Ring-2: Type Declarations → Zig

Ghuloum step: #3 (unary prims — single-thing operations)
One capability: t27c gen outputs valid Zig enum/struct declarations
Depends on: Ring-1 (#3)

Acceptance Test

./bootstrap/target/release/t27c gen tests/ring0_trivial.t27 > /tmp/test.zig
grep -q "const ONE: i8 = 1;" /tmp/test.zig && echo "PASS" || echo "FAIL"

Scope

  • Zig codegen for const declarations (all literal forms)
  • Zig codegen for enum declarations
  • Zig codegen for struct declarations
  • Generated Zig header comment with phi^2 + 1/phi^2 = 3

phi^2 + 1/phi^2 = 3 | TRINITY

Activity

  1. added
    seed-ringSEED-RINGS language evolution ring
    phi-loopPHI LOOP development cycle
    on Apr 4, 2026
  2. gHashTag commented on Apr 4, 2026

    @gHashTag
    CollaboratorAuthor

    🟢 Ring-2 started: Type declarations → Zig codegen
    Branch: ring/2-type-decl-gen

  3. gHashTag commented on Apr 4, 2026

    @gHashTag
    CollaboratorAuthor

    ⚙️ Progress: Codegen outputs 5 const declarations for ring0_trivial.t27, 15 consts + 1 enum (Trit) + 1 struct (UnpackResult) + 35 fn stubs for types.t27

    All 29 .t27 files parse and generate without errors.

    Key fixes:

    • Enum variant values now emitted correctly (neg = -1, zero = 0, pos = 1)
    • Struct fields parsed and emitted with types
    • Array type aliases handled ([WORD_BYTES]u8)
    • Function stubs include @CompileError("not yet implemented")
    • Header includes module name and phi signature
  4. added a commit that references this issue on Apr 4, 2026
    2d64dea
  5. gHashTag commented on Apr 4, 2026

    @gHashTag
    CollaboratorAuthor

    🔗 PR opened: #10

  6. gHashTag commented on Apr 4, 2026

    @gHashTag
    CollaboratorAuthor

    🎉 Ring-2 MERGED: Type declarations → Zig codegen complete

    t27c gen now outputs valid Zig for:

    • ✅ 5 const declarations (ring0_trivial.t27)
    • ✅ 15 consts + 1 enum + 1 struct + 35 fn stubs (types.t27)
    • ✅ All 29 .t27 files parse and generate without errors
    • ✅ No regressions in ring-0 or ring-1
  7. added 5 commits that reference this issue on Jun 1, 2026
    715e670
    7011f8b
    aa6726e
    4d543ae
    52e94e4
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

    phi-loopPHI LOOP development cycleseed-ringSEED-RINGS language evolution ring

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions