-
Notifications
You must be signed in to change notification settings - Fork 6
Quickstart
This page provides the minimal setup and execution workflow for Ternlang and the Ternary Intelligence Stack (TIS).
The objective is to:
- install the CLI
- run a
.ternfile - validate ternary state execution
- compile BET bytecode
- verify local toolchain integrity
Before starting, ensure the following tools are available:
- Rust toolchain (
cargo, stable) - terminal environment (Linux / macOS / Windows)
- Git (optional, for source build)
Verify Cargo:
cargo --versionInstall the Ternlang CLI via Cargo:
cargo install ternlang-cliValidate installation:
ternlang --helpExpected command groups include:
run
build
repl
fmt
audit
translate
Create a new file:
touch quickstart.ternInsert the following:
fn classify(signal: trit) -> trit {
match signal {
reject => { return reject; }
tend => { return tend; }
affirm => { return affirm; }
}
}
let output: trit = classify(affirm);
match output {
reject => { return reject; }
tend => { return tend; }
affirm => { return affirm; }
}
This defines a minimal ternary classification flow.
Execute:
ternlang run quickstart.ternExpected output:
affirm
This validates:
- parser
- AST generation
- exhaustive ternary match logic
- BET VM execution
| Trit | State | Interpretation |
|---|---|---|
reject |
negative | block / veto |
tend |
neutral | uncertainty / hold |
affirm |
positive | accept / proceed |
The tend state acts as a formal uncertainty carrier.
Launch the interactive shell:
ternlang replExample:
consensus(affirm, tend)
Expected output:
tend
This performs a minimal ternary aggregation.
Build bytecode output:
ternlang build quickstart.tern --output quickstart.betThis validates:
- frontend compilation
- opcode lowering
- bytecode serialization
Output artifact:
quickstart.bet
Browse the full standard library modules:
https://github.com/eriirfos-eng/ternary-intelligence-stack/tree/main/ternlang-root/stdlib
This includes:
std::*ml::*nn::*stats::*vision::*qnn::*
Execute a built-in example:
ternlang run examples/05_medical_triage.ternBrowse the full example collection:
Examples include:
- medical triage
- aerospace systems
- infrastructure control
- finance
- AI agent workflows
ternlang run quickstart.tern
ternlang fmt quickstart.tern --write
ternlang build quickstart.tern --output quickstart.bet
ternlang repl