tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

README.md (3046B)


tricu

tricu (pronounced "tree-shoe") is an experimental programming language built on Tree Calculus. Functions and data have the same tree representation: a program can inspect another program's structure as well as apply it.

The portable compiler and libraries are written in tricu. A Haskell host runs the resulting trees; Arboricx bundles carry compiled programs between compatible hosts. arbori.cx lets you try programs, compile source, and export trees in your browser.

!export main

first [value | _] = value
first _ = 0

main = first [42 7]

This program returns 42. Equations match in order; the second equation handles anything that is not a nonempty list.

Get started

Download the latest repository archive and build the Haskell host with Nix:

curl -fLO https://git.eversole.co/James/tricu/tricu-main.tar.gz
tar -xzf tricu-main.tar.gz
cd tricu-main
nix build .#

Then follow Build and run to run the example and package it as an Arboricx bundle. The stable compiler is included at bootstrap/build-stable.arboricx and selected automatically. --toolchain overrides it explicitly.

The language, formats, and tools are experimental.

Documentation

Other hosts under ext/ are experimental; use the Haskell host for native development and validation.

Acknowledgements

Tree Calculus was discovered by Barry Jay. Johannes Bader suggested the Triage Calculus rules and created treecalcul.us, an interactive playground for his language LambAda.

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