A small, closed language for application intent — it reads like Python or TypeScript, and it compiles to a self-contained native binary.
You write the intent. The compiler writes the Rust.
Topaz is written by people and by agents and checked by the toolchain. For each intent there is exactly one canonical form, locked in the Topaz v5.2 specification. The canonical documentation lives at ** topaz.ooo**; this repository is the compiler, runtime, and conformance corpus behind it.
A small, closed surface. One way to say each thing. The language decides policy —Result
for recoverable failure, optionals for absence,defer
for cleanup — so people and agents don't re-decide it per file.Unicode-first identity. Identifiers are Unicode from the lexer up; domain words stay in your language instead of becoming romanized approximations. No silent normalization — what you wrote is what compares equal.Agent-ready by design. A specification small enough to hold in full, machine-checkable profiles, and documentation that is itself verified against the toolchain.Templates with intent.sql
,sh
, andpath
strings are structured templates whose parts and interpolations stay separate — safety as grammar, not discipline.
function greet(name: string, language: string) -> string {
return match language {
case "한국어" => "안녕하세요, {name}님!"
case "Русский" => "Привет, {name}!"
case _ => "Hello, {name}!"
}
}
let 사용자 = "김토파즈"
print(greet(사용자, "한국어"))
print(greet("Topaz", "Русский"))
사용자
is an ordinary variable.
Rust is the substrate; Topaz is the surface. topaz run
executes a
program through the reference interpreter, and topaz build
lowers it to Rust and compiles a self-contained native binary — offline, from a runtime closure the compiler carries itself, with no Topaz runtime to install on the target:
topaz run examples/hello.tpz # execute via the interpreter
topaz build examples/hello.tpz \ # lower to Rust, build a native binary,
--out-dir out --run # and run it — prints "Hello, Topaz!"
The emitter is held to the interpreter by a differential harness: every fixture runs through both engines and must agree, so the binary behaves exactly as the reference does.
The Topaz v5.2 language is locked, and this toolchain implements it
end to end — a Unicode-first front end and module resolver, a whole-unit
static type checker (topaz check
), the reference interpreter
(topaz run
), and native code generation (topaz emit
/ topaz build
).
The toolchain is pure Rust with zero external (crates.io) dependencies
and forbid(unsafe_code)
across the workspace.
v5.2.0 is the first public release. It is an early release — there are no API-stability or performance promises yet, only that the toolchain does what the locked specification says. topaz.ooo is the source of truth for what runs today and the gates that prove it.
Prebuilt binary. Download topaz
for your platform from the
GitHub Releases page and
put it on your PATH
.
From source. With a Rust toolchain installed:
git clone https://github.com/studiohaze/topaz
cd topaz
cargo build --release # the driver lands at target/release/topaz
topaz run
, check
, and emit
work from the standalone binary;
topaz build
shells out to cargo
through rustup
, so that one command needs a Rust toolchain present.
| Command | What it does |
|---|---|
topaz run <entry> |
|
Execute a program through the reference interpreter (--root <dir> for a multi-file unit). |
|
topaz check <entry> |
|
| Parse, resolve, and type-check a whole compilation unit. | |
topaz build <entry> --out-dir <dir> |
|
Lower to Rust and build a native binary (--release to optimize; --run to execute it). |
|
topaz emit <entry> |
|
Lower a single-module program to Rust source — to stdout, or with --out-dir <dir> a cargo run -able crate. |
|
topaz parse <file> / topaz dump-ast <file> |
|
| Parse and report diagnostics, or print the AST. | |
topaz version [--verbose] |
|
| Print the toolchain version. |
The language version defaults to 5.2; pass --language-version 5.1
for the frozen single-file mode.
— the canonical, verified documentation (introduction, guides, language reference) in English, Korean, and Russian.topaz.ooo— small runnable programs (each parses, type-checks, runs, andexamples/
topaz build
s).— why Topaz exists and where it doesdocs/PHILOSOPHY.md
notcompete.— the vendored, read-only language specification (v5.1 frozen, v5.2 locked).spec/
— the Compiler Design Record ledger.docs/design/
This compiler is developed by AI agents under an adversarial, dialectic review protocol against the locked specification (see docs/design/CDR-005.md). The CI gates are the contract; run them locally with:
cargo fmt --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace # 635 tests, including the corpus + differential harnesses
cargo run -p topaz_cli -- check-corpus # the golden parse/exec gates
Questions & ideas→GitHub Discussions.** Bugs & feature requests→GitHub Issues. Anything else**→contact@topaz.ooo.
— how to build, test, and report issues.CONTRIBUTING.md
— how to report a vulnerability.SECURITY.md
— the community standard (enforcement:CODE_OF_CONDUCT.md
Topaz is licensed under the Apache License 2.0. It includes data derived from the Unicode Character Database; the required attribution is in NOTICE.