Rename from sapling to tricu
This commit is contained in:
43
README.md
43
README.md
@ -1,10 +1,12 @@
|
||||
# sapling
|
||||
# tricu
|
||||
|
||||
## Introduction
|
||||
|
||||
sapling is a "micro-language" that [I'm](https://eversole.co) working on to investigate [Tree Calculus](https://github.com/barry-jay-personal/typed_tree_calculus/blob/main/typed_program_analysis.pdf) .
|
||||
tricu (pronounced like "tree-shoe") is a "micro-language" that [I'm](https://eversole.co) working on to investigate [Tree Calculus](https://github.com/barry-jay-personal/typed_tree_calculus/blob/main/typed_program_analysis.pdf).
|
||||
|
||||
It offers a minimal amount of syntax sugar yet provides a complete and intuitive programming environment. Sapling offers:
|
||||
tricu [means tree in Lojban](https://en.wiktionary.org/wiki/Appendix:Lojban/tricu). This project was named "sapling" until I discovered the name was already being used for other projects in programming language development.
|
||||
|
||||
tricu offers a minimal amount of syntax sugar yet provides a complete and intuitive programming environment. tricu offers:
|
||||
|
||||
- `t` operator behaving by the rules of Tree Calculus
|
||||
- Function ("variable") definitions
|
||||
@ -21,36 +23,35 @@ _ = t
|
||||
true = t t
|
||||
-- We can define functions as lambda expressions that are eliminated to tree
|
||||
-- calculus terms.
|
||||
id = (\a : a) -- t (t (t t)) t
|
||||
triage = (\a b c : t (t a b) c)
|
||||
id = (\a : a) -- `id` evaluates to the TC form of: t (t (t t)) t
|
||||
triage = (\a b c : t (t a b) c)
|
||||
-- Intensionality !!!
|
||||
-- Intensionality! We can inspect program structure, not just inputs/outputs:
|
||||
test = triage "Leaf" (\_ : "Stem") (\_ _ : "Fork")
|
||||
|
||||
-- REPL
|
||||
-- `sapling <` is the input prompt
|
||||
-- `sapling >` is the Tree Calculus form output. Most are elided below.
|
||||
-- `DECODE -:` is an attempt to interpret the TC output as strings/numbers.
|
||||
sapling < test t
|
||||
sapling > Fork (Fork Leaf (Fork ...) ... )
|
||||
DECODE -: "Leaf"
|
||||
sapling < test (t t)
|
||||
DECODE -: "Stem"
|
||||
sapling < test (t t t)
|
||||
DECODE -: "Fork"
|
||||
sapling < map (\i : listConcat i " is super cool!") [("He") ("She") ("Everybody")]
|
||||
DECODE -: ["He is super cool!", "She is super cool!", "Everybody is super cool!"]
|
||||
-- `tricu <` is the input prompt
|
||||
-- `tricu >` is the Tree Calculus form output. Most are elided below.
|
||||
-- `READ -:` is an attempt to interpret the TC output as strings/numbers.
|
||||
tricu < test t
|
||||
tricu > Fork (Fork Leaf (Fork ...) ... )
|
||||
READ -: "Leaf"
|
||||
tricu < test (t t)
|
||||
READ -: "Stem"
|
||||
tricu < test (t t t)
|
||||
READ -: "Fork"
|
||||
tricu < map (\i : listConcat i " is super cool!") [("Tree Calculus") ("Intensionality") ("tricu")]
|
||||
READ -: ["Tree Calculus is super cool!", "Intensionality is super cool!", "tricu is super cool!"]
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
You can easily build and/or run this project using [Nix](https://nixos.org/download/).
|
||||
|
||||
- Build REPL binary: `nix build git+https://git.eversole.co/James/sapling`
|
||||
- Run REPL: `nix run git+https://git.eversole.co/James/sapling`
|
||||
- Build REPL binary: `nix build git+https://git.eversole.co/James/tricu`
|
||||
- Run REPL: `nix run git+https://git.eversole.co/James/tricu`
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
Tree Calculus was discovered by [Barry Jay](https://github.com/barry-jay-personal/blog).
|
||||
|
||||
[treecalcul.us](https://treecalcul.us) is an excellent website with an intuitive playground created by [Johannes Bader](https://johannes-bader.com/) that introduced me to Tree Calculus. If sapling sounds interesting but compiling this repo sounds like a hassle, you should check out his site.
|
||||
[treecalcul.us](https://treecalcul.us) is an excellent website with an intuitive playground created by [Johannes Bader](https://johannes-bader.com/) that introduced me to Tree Calculus. If tricu sounds interesting but compiling this repo sounds like a hassle, you should check out his site.
|
||||
|
Reference in New Issue
Block a user