Install

Get started

From a clean machine to running ManiT on both backends. Steps match the OSS handbook in the maniTC repository.

0. Prerequisites

  • Rust 1.70+ with Cargo
  • clang (scripts often default to clang-19) — needed for native LLVM execution
  • Linux is the reference platform

1. Build the compiler

git clone https://github.com/manishthatte/maniTC
cd maniTC
cargo build --release
export PATH="$PATH:$(pwd)/target/release"

You now have manitc. Check with manitc --help.

2. First program — T3ISA (emulated)

Create hello.mt:

use std::io;

fn main() {
    io::println("Hello from the ternary world!");
}
manitc compile --target t3 hello.mt
manitc run-t3 a.t3b

Add --debug to run-t3 for the interactive debugger.

3. The same program, natively

manitc compile --target llvm hello.mt -o hello.ll
clang-19 -O2 -c runtime/manit_runtime.c -o manit_runtime.o
clang-19 hello.ll manit_runtime.o -o hello -lm
./hello

Or compare both backends: manitc bench examples/fibonacci.mt.

4. Meet the trits

let a: trit = +;
tif a {
    + => io::println("positive"),
    0 => io::println("zero"),
    - => io::println("negative"),
}

let sensor: bool3 = unknown;
let n = 0t+0-;   // balanced ternary literal = 8
  • Negation is free — balanced ternary is symmetric; there is no sign bit.
  • unknown is a valuebool3 follows Kleene three-valued logic.
  • tif is one instruction on T3ISA.

5. Next

Not in this release: the trit package manager. Install from source as above.

Full handbook: GETTING_STARTED.md on GitHub.