1.8 KiB
1.8 KiB
AGENTS.md - tricu Project Guide
For AI agents and contributors working in this repository.
Build & Test
# Tests
nix flake check
# Build tricu executable
nix build .#
Never call cabal directly
Rule of thumb: if it builds, links, or tests, it goes through
nix.
Write and test, don't mentally trace
nix flake check finishes quickly. Use it.
tricu's minimalism makes it easy to build a confident-sounding but wrong
mental model of evaluation order, branch selection (matchBool arg order),
or number encoding. A quick test replaces many minutes of uncertain reasoning.
Prefer:
- Write a candidate implementation.
- Run the tests or a probe.
- Fix what's wrong.
Over:
- Reason about semantics across multiple files.
- Build up a chain of inference.
- Write code that assumes the chain was correct.
Project Overview
tricu (pronounced "tree-shoe") is a programming-language experiment written primarily in Haskell.
Core types are in src/Research.hs.
File extensions
.hs- Haskell source.tri- tricu language source (used inlib/,test/,demos/).arboricx- Portable executable bundle.dag- Serialized kernel DAG (used bygen_kernel.zigat build time)
Haskell tests
Tests live in test/Spec.hs and use Tasty + HUnit.
nix flake check
tricu Language Quick Reference
t → Leaf (the base term)
t t → Stem Leaf
t t t → Fork Leaf Leaf
x = t → Define term x = Leaf
id = (a : a) → Lambda identity (eliminates to tree calculus)
head (map f xs) → From lib/list.tri
!import "./path.tri" NS → Import file under namespace
-- line comment
CRITICAL:
When working with tricu .tri files YOU MUST REVIEW notes/tricu-normalization-rules.md