2026-05-19 19:50:38 -05:00
2026-05-16 09:33:14 -05:00
2026-05-19 20:06:54 -05:00
2026-05-19 20:06:54 -05:00
2026-05-19 17:00:36 -05:00
2026-05-19 19:50:38 -05:00
2026-05-11 09:18:47 -05:00
2024-12-18 19:15:56 -06:00
2026-05-19 17:00:36 -05:00

tricu

Introduction

tricu (pronounced "tree-shoe") is an experimental programming language written in Haskell. It is fundamentally based on the application of Triage Calculus, an extended form of Tree Calculus. I will refer to this "family" of calculi as TC.

tricu is the word for "tree" in Lojban: (x1) is a tree of species/cultivar (x2).

In the ext/ directory there are implementations of TC evaluators and tooling in other languages. Here be dragons; beware.

I have fully embraced the slopmachine (LLM-assisted development) for this project. Nothing is stable or sacred. We will discover sanity at the end of the journey but we won't strive for it until then.

This README.md is 100% human written. No other .md file will be until stabilization.

Acknowledgements

Tree Calculus was discovered by Barry Jay. The addition of Triage rules were suggested by Johannes Bader. Johannes is also the creator of treecalcul.us which has a great intuitive code playground using his language LambAda.

REPL examples

tricu < -- Anything after `--` on a single line is a comment
tricu < id = (a : a) -- Lambda abstraction is eliminated to tree calculus terms
tricu < head (map (i : append i " world!") [("Hello, ")])
tricu > "Hello,  world!"
tricu < id (head (map (i : append i " world!") [("Hello, ")]))
tricu > "Hello,  world!"

tricu < -- Intensionality! We can inspect the structure of a function or data.
tricu < triage = (a b c : t (t a b) c)
tricu < test = triage "Leaf" (z : "Stem") (a b : "Fork")
tricu < test (t t)
tricu > "Stem"
tricu < -- We can even convert a term back to source code (/demos/toSource.tri)
tricu < toSource not?
tricu > "(t (t (t t) (t t t)) (t t (t t t)))"
tricu < -- or calculate its size (/demos/size.tri)
tricu < size not?
tricu > 12

tricu < !help
tricu version 1.1.0
Available commands:
  !exit        - Exit the REPL
  !clear       - Clear the screen
  !reset       - Reset preferences for selected versions
  !help        - Show tricu version and available commands
  !output      - Change output format (tree|fsl|ast|ternary|ascii|decode)
  !definitions - List all defined terms in the content store
  !import      - Import definitions from file to the content store
  !watch       - Watch a file for changes, evaluate terms, and store them
  !versions    - Show all versions of a term by name
  !select      - Select a specific version of a term for subsequent lookups
  !tag         - Add or update a tag for a term by hash or name
  !export      - Export a term bundle to file (hash, file)
  !bundleimport- Import a bundle file into the content store

Installation and Use

You can easily build and run this project using Nix.

  • Quick Start (REPL):
    • nix run git+https://git.eversole.co/James/tricu
  • Build executable in ./result/bin:
    • nix build git+https://git.eversole.co/James/tricu

./result/bin/tricu --help

Usage

I'll update this once the CLI stabilizes more.

Description
An interpreted language for exploring Tree Calculus
Readme ISC 2.5 MiB
Languages
Haskell 76.2%
Zig 12.5%
C 4.2%
JavaScript 2.8%
PHP 1.6%
Other 2.7%