THE LANGUAGE

Less syntax.
More signal.

Tokit is a compact, statically typed language for code written with language models. Write a little, check precisely, and run it natively.

Open source · MIT or Apache-2.0 · Version 0.1

cart.tokTOKIT / 001
struct Item{name:String,price:F}
total(items:[Item])->F{
  fold(items,0.0,|sum,i|sum+i.price)
}
main()->String{
  let cart=[Item("tea",3.5),
            Item("cake",4.25)];
  "total "+String(total(cart))
}
$ tok run cart.tok"total 7.75"
01 / THE IDEABUILT FOR A SHORT FEEDBACK LOOP

A language that gets
to the point.

Small programs should stay small. Tokit keeps syntax concise, gives each program a canonical form, and reports errors in a way a person or an agent can act on.

Explore the specifications
01

Compact by design

Types, pattern matching, and functions without the ceremony. tok fmt keeps one consistent shape.

02

Errors with a next step

Stable diagnostic codes, source positions, and JSON output make tok check useful in an editing loop.

03

Real executables

Interpret while exploring, or use tok build to compile a native executable with Rust.

02 / THE LANGUAGESMALL SURFACE, USEFUL TOOLS

Readable at a glance.

Values, enums, and exhaustive matches fit together without hiding the control flow.

area.tokEXAMPLE 01
enum Shape{Circle(F),Square(F)}
area(s:Option<Shape>)->F{
  match s{
    Some(Shape::Circle(r))=>pi()*r*r,
    Some(Shape::Square(a))=>a*a,
    None=>0.0
  }
}
main()->F{area(Some(Shape::Square(3.0)))}

IN THE LANGUAGE

  • 01 Static types and inference
  • 02 Records and enums with payloads
  • 03 Exhaustive pattern matching
  • 04 Results and ? propagation
Browse working examples
03 / THE TOOLINGFEEDBACK YOU CAN USE

The compiler tells you what to fix.

Check a file before running it. Diagnostics include a code, location, and concrete message. Use --json to read them from an editor or an agent.

See diagnostic codes
TERMINALtok check
$ tok check --json shapes.tok
{
  "ok": false,
  "error": {
    "code": "E116",
    "line": 2, "column": 26,
    "message": "non-exhaustive match: missing Some(Square)"
  }
}
tok runExplore instantly
tok checkCatch mistakes
tok fmtKeep one form
tok buildShip a binary

BEYOND THE FIRST PROGRAM

Explicit permissionsFile, network, and process access require grants such as --allow-net.
Ready for servicesHTTP, WebSocket, JSON, Redis, and PostgreSQL packages ship with the compiler.
Editor and target supportUse tok lsp, the VS Code extension, or build for WASI.
04 / GET STARTEDFROM ZERO TO RUNNING

Start with one command.

The installer fetches a release and verifies its SHA-256. Add Rust when you want native builds.

curl -sSf https://raw.githubusercontent.com/AlphaVIE/tokit/main/scripts/install.sh | sh
THEN TRY ITtok new hello && cd hellotok run main.tok

KEEP EXPLORING

Everything you need
to go further.