Tricu 2.0.0
Sorry for squashing all of this but 🤷
This commit is contained in:
84
README.md
84
README.md
@@ -2,7 +2,7 @@
|
||||
|
||||
## Introduction
|
||||
|
||||
tricu (pronounced "tree-shoe") is an experimental programming language written in Haskell. It is fundamentally based on the application of [Triage Calculus](https://olydis.medium.com/a-visual-introduction-to-tree-calculus-2f4a34ceffc2), an extended form of [Tree Calculus](https://github.com/barry-jay-personal/typed_tree_calculus/blob/main/typed_program_analysis.pdf). I will refer to this "family" of calculi as TC.
|
||||
tricu (pronounced "tree-shoe") is an experimental programming language written in Haskell. It is fundamentally based on the application of [Triage Calculus](https://olydis.medium.com/a-visual-introduction-to-tree-calculus-2f4a34ceffc2), an extended form of [Tree Calculus](https://github.com/barry-jay-personal/typed_tree_calculus/blob/main/typed_program_analysis.pdf). I refer to this "family" of calculi as TC below.
|
||||
|
||||
tricu is the word for "tree" in Lojban: `(x1) is a tree of species/cultivar (x2)`.
|
||||
|
||||
@@ -37,23 +37,6 @@ 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
|
||||
@@ -69,4 +52,67 @@ You can easily build and run this project using [Nix](https://nixos.org/download
|
||||
|
||||
## Usage
|
||||
|
||||
I'll update this once the CLI stabilizes more.
|
||||
### CLI
|
||||
|
||||
Evaluate one or more files:
|
||||
|
||||
```sh
|
||||
tricu eval program.tri
|
||||
tricu eval --format decode program.tri
|
||||
tricu eval --output result.txt program.tri
|
||||
```
|
||||
|
||||
Annotated programs run normally under `eval`; annotations are metadata, not
|
||||
runtime types. If you want evaluation to ignore View Contracts completely while
|
||||
loading workspace modules, use unchecked mode:
|
||||
|
||||
```sh
|
||||
tricu eval --unchecked program.tri
|
||||
```
|
||||
|
||||
Unchecked eval parses annotation syntax, discards contract metadata, skips
|
||||
producer-side View Contract checks during workspace module auto-builds, and does
|
||||
not publish unchecked View refs. Executable module exports may still be cached in
|
||||
the content store.
|
||||
|
||||
Check View Contract annotations explicitly:
|
||||
|
||||
```sh
|
||||
tricu check program.tri
|
||||
tricu check --store ./.tricu-store program.tri
|
||||
```
|
||||
|
||||
Compile/import/export Arboricx bundles:
|
||||
|
||||
```sh
|
||||
tricu arboricx compile --file program.tri --output program.arboricx
|
||||
tricu arboricx import --file program.arboricx --module program
|
||||
tricu arboricx export --module prelude --output prelude.arboricx
|
||||
```
|
||||
|
||||
Inspect store aliases:
|
||||
|
||||
```sh
|
||||
tricu store alias list --kind modules
|
||||
tricu store alias get --kind modules prelude
|
||||
```
|
||||
|
||||
### REPL
|
||||
|
||||
Running `tricu` with no subcommand starts the REPL. The REPL uses the same
|
||||
filesystem content store and workspace module loader as the CLI.
|
||||
|
||||
Useful commands:
|
||||
|
||||
```text
|
||||
!load FILE load/evaluate a .tri file without printing a result
|
||||
!check FILE run View Contract checking for a file
|
||||
!store [PATH] show or set the content-addressed store
|
||||
!unchecked on evaluate loaded files without contract checking/publishing refs
|
||||
!unchecked off return to normal producer-checked module loading
|
||||
!format decode set output format by name
|
||||
!env list current in-memory bindings
|
||||
```
|
||||
|
||||
`!load` and `!check` support filename tab completion. Normal REPL input also
|
||||
supports tab completion for names currently in the REPL environment.
|
||||
|
||||
Reference in New Issue
Block a user