Files
tricu/AGENTS.md

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:

  1. Write a candidate implementation.
  2. Run the tests or a probe.
  3. Fix what's wrong.

Over:

  1. Reason about semantics across multiple files.
  2. Build up a chain of inference.
  3. 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 in lib/, test/, demos/)
  • .arboricx - Portable executable bundle
  • .dag - Serialized kernel DAG (used by gen_kernel.zig at 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