A Forth-inspired language for builders

Small words.
Big ideas.

Compact code with visible flow, meaningful names, and checked types.

Experimental · Go interpreter · Compiles to WebAssembly and native Go — browser runs need wasm-gc, roughly Chrome 119+, Firefox 120+, or Safari 18.2+

One file · One flow

See where every value goes.

Read a name, pass it through one word, and print the result. The program stays compact without hiding its sequence.

hello.zhex →Console input → output
word greet(name: String) -> String
    "Hello, " + name + "!"

let name = read-line "Your name: " try

flow name
    greet
    print
With input: Ada
Your name: Hello, Ada!

Readable foundations

Compact does not have to mean cryptic.

Zhex keeps the compositional spirit of Forth while making data movement and intent easy to follow — for human reviewers and AI agents alike.

01 · Flow

Visible movement.

Explicit flows show how one result becomes the next input.

02 · Meaning

Named values.

Important values carry names instead of living only as stack positions.

03 · Confidence

Checked types.

Word signatures catch mismatches before a program reaches its result.

04 · Agents

Friendly to AI.

Visible structure and strict checks let coding agents write correct Zhex, and people review it faster.

Start with code

Four programs. Four practical ideas.

Follow the language from console input through conditions, loops, local state, and text operations.

Build it yourself

Build your first Zhex program.

Build the interpreter once, then run programs from your terminal. The interpreter supports small working programs today — clone the public repository and run them yourself.

git clone https://github.com/desireco/zhex.git
cd zhex
go build -o bin/zhex ./cmd/zhex
export PATH="$PWD/bin:$PATH"
zhex run examples/hello.zhex

The repository is public and MIT licensed. Browse the source, follow Getting started for the per-OS setup steps, review what comes next, or follow the project board.

Beyond the interpreter

Compile to WebAssembly or native Go.

The same checked program becomes a standalone WebAssembly module — roughly 38–40 KB gzipped — for a web page or a WASI runner such as wasmtime, or a native Go binary that keeps the interpreter's full 128-bit integers.

zhex compile examples/collatz.zhex --target=wasi
wasmtime run --dir .::/ examples/collatz.wasm

Compiling checks the program exactly like zhex run; the WebAssembly targets need the free wasm-tools assembler, the native target needs Go. Read the compiling guide →

Support

Sponsors and partners.

Zhex is developed by Dakic OnLine LLC, with room for partners who want to back the language.

Lead sponsor

Dakic OnLine LLC.

Zeljko Dakic develops and sponsors Zhex — small words, big ideas, built as a working language.

Open invitation

Partner with Zhex.

Interested in sponsoring or partnering? Start the conversation on GitHub.