Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 2.26 KB

AGENTS.md

File metadata and controls

40 lines (29 loc) · 2.26 KB

Tya Development Guidelines

Tya is a language without hesitation — an indentation-based, dynamically typed, compile-to-C language. The implementation is hand-written in Go. Tya commits to a Canonical Syntax (every program has exactly one source representation) and an all-in-one toolchain. Before editing, inspect the existing lexer, parser, AST, checker, C emitter, runner, tests, and examples that are closest to the requested behavior.

Project Rules

  • Prefer the current hand-written compiler style over adding parser generators or large dependencies.
  • Keep language syntax and naming consistent with docs/SPEC.md.
  • Keep stdlib behavior consistent with docs/SPEC.md.
  • Treat docs/archive/pre-v0.1/ and selfhost/ as historical reference only. They are not current implementation or specification authority.
  • Keep the hand-written Go lexer, parser, AST, checker, and C emitter as the single compiler implementation. Generated programs continue to target C and link the C runtime with the Tya-managed Zig toolchain.
  • Use ROADMAP.md as the single source of truth for TODO, TASK, and roadmap planning. Express roadmap work as Markdown nested task lists: top-level items are Epics, second-level items are Milestones, and third-level items are Tasks. A Milestone is complete when every Task below it is complete, and an Epic is complete when every Milestone below it is complete.
  • Do not rewrite unrelated user changes.

Verification

Run gofmt -w on changed Go files.

Default verification:

go test ./... -count=1

Use focused scripts under scripts/ when changes affect examples, C emission, imports, runtime execution, or stdlib loading.

For long-running verification, prefer the tmux-backed Codex runner so work continues if the Codex session disconnects:

scripts/codex-run.sh start --timeout 25m full-test go test ./... -count=1 -timeout=20m
scripts/codex-run.sh status full-test
scripts/codex-run.sh tail full-test

Runner logs and exit codes are written under .codex-runs/. The runner starts the command in a separate tmux session and process group, so a crashing or hanging Tya process should only fail that external run. Inspect it from Codex with status and tail; avoid running crash-prone tya commands directly in the Codex foreground process.