{"slug": "show-hn-topaz-a-small-unicode-first-language-that-compiles-to-rust", "title": "Show HN: Topaz – A small Unicode-first language that compiles to Rust", "summary": "Topaz, a small Unicode-first programming language that compiles to Rust, has been released as an open-source project. The language features a locked v5.2 specification, agent-ready design, and produces self-contained native binaries. It aims to provide a canonical surface for application intent with Unicode identifiers and structured templates.", "body_md": "**A small, closed language for application intent — it reads like Python\nor TypeScript, and it compiles to a self-contained native binary.**\n\nYou write the intent. The compiler writes the Rust.\n\nTopaz is written by people and by agents and checked by the toolchain.\nFor each intent there is exactly one canonical form, locked in the\n**Topaz v5.2** specification. The canonical documentation lives at\n** topaz.ooo**; this repository is the compiler,\nruntime, and conformance corpus behind it.\n\n**A small, closed surface.** One way to say each thing. The language decides policy —`Result`\n\nfor recoverable failure, optionals for absence,`defer`\n\nfor 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`\n\n,`sh`\n\n, and`path`\n\nstrings are structured templates whose parts and interpolations stay separate — safety as grammar, not discipline.\n\n``` php\nfunction greet(name: string, language: string) -> string {\n    return match language {\n        case \"한국어\" => \"안녕하세요, {name}님!\"\n        case \"Русский\" => \"Привет, {name}!\"\n        case _ => \"Hello, {name}!\"\n    }\n}\n\nlet 사용자 = \"김토파즈\"\nprint(greet(사용자, \"한국어\"))\nprint(greet(\"Topaz\", \"Русский\"))\n```\n\n`사용자`\n\nis an ordinary variable.\n\nRust is the substrate; Topaz is the surface. `topaz run`\n\nexecutes a\nprogram through the reference interpreter, and `topaz build`\n\nlowers it\nto Rust and compiles a **self-contained native binary** — offline, from\na runtime closure the compiler carries itself, with no Topaz runtime to\ninstall on the target:\n\n```\ntopaz run   examples/hello.tpz          # execute via the interpreter\ntopaz build examples/hello.tpz \\        # lower to Rust, build a native binary,\n      --out-dir out --run               #   and run it — prints \"Hello, Topaz!\"\n```\n\nThe 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.\n\nThe **Topaz v5.2** language is *locked*, and this toolchain implements it\nend to end — a Unicode-first front end and module resolver, a whole-unit\nstatic type checker (`topaz check`\n\n), the reference interpreter\n(`topaz run`\n\n), and native code generation (`topaz emit`\n\n/ `topaz build`\n\n).\nThe toolchain is pure Rust with zero external (crates.io) dependencies\nand `forbid(unsafe_code)`\n\nacross the workspace.\n\n**v5.2.0 is the first public release.** It is an early release — there\nare no API-stability or performance promises yet, only that the toolchain\ndoes what the locked specification says. [topaz.ooo](https://topaz.ooo)\nis the source of truth for what runs today and the gates that prove it.\n\n**Prebuilt binary.** Download `topaz`\n\nfor your platform from the\n[GitHub Releases](https://github.com/studiohaze/topaz/releases) page and\nput it on your `PATH`\n\n.\n\n**From source.** With a [Rust toolchain](https://rustup.rs) installed:\n\n```\ngit clone https://github.com/studiohaze/topaz\ncd topaz\ncargo build --release          # the driver lands at target/release/topaz\n```\n\n`topaz run`\n\n, `check`\n\n, and `emit`\n\nwork from the standalone binary;\n`topaz build`\n\nshells out to `cargo`\n\nthrough `rustup`\n\n, so that one command\nneeds a Rust toolchain present.\n\n| Command | What it does |\n|---|---|\n`topaz run <entry>` |\nExecute a program through the reference interpreter (`--root <dir>` for a multi-file unit). |\n`topaz check <entry>` |\nParse, resolve, and type-check a whole compilation unit. |\n`topaz build <entry> --out-dir <dir>` |\nLower to Rust and build a native binary (`--release` to optimize; `--run` to execute it). |\n`topaz emit <entry>` |\nLower a single-module program to Rust source — to stdout, or with `--out-dir <dir>` a `cargo run` -able crate. |\n`topaz parse <file>` / `topaz dump-ast <file>` |\nParse and report diagnostics, or print the AST. |\n`topaz version [--verbose]` |\nPrint the toolchain version. |\n\nThe language version defaults to **5.2**; pass `--language-version 5.1`\n\nfor the frozen single-file mode.\n\n— the canonical, verified documentation (introduction, guides, language reference) in English, Korean, and Russian.[topaz.ooo](https://topaz.ooo)— small runnable programs (each parses, type-checks, runs, and`examples/`\n\n`topaz build`\n\ns).— why Topaz exists and where it does`docs/PHILOSOPHY.md`\n\n*not*compete.— the vendored, read-only language specification (v5.1 frozen, v5.2 locked).`spec/`\n\n— the Compiler Design Record ledger.`docs/design/`\n\nThis compiler is developed by AI agents under an adversarial, dialectic\nreview protocol against the locked specification (see\n[ docs/design/CDR-005.md](/studiohaze/topaz/blob/main/docs/design/CDR-005.md)). The CI gates are the\ncontract; run them locally with:\n\n```\ncargo fmt --check\ncargo clippy --workspace --all-targets -- -D warnings\ncargo test --workspace               # 635 tests, including the corpus + differential harnesses\ncargo run -p topaz_cli -- check-corpus   # the golden parse/exec gates\n```\n\n**Questions & ideas**→[GitHub Discussions](https://github.com/studiohaze/topaz/discussions).** Bugs & feature requests**→[GitHub Issues](https://github.com/studiohaze/topaz/issues).** Anything else**→[contact@topaz.ooo](mailto:contact@topaz.ooo).\n\n— how to build, test, and report issues.`CONTRIBUTING.md`\n\n— how to report a vulnerability.`SECURITY.md`\n\n— the community standard (enforcement:`CODE_OF_CONDUCT.md`\n\n[coc@topaz.ooo](mailto:coc@topaz.ooo)).\n\nTopaz is licensed under the [Apache License 2.0](/studiohaze/topaz/blob/main/LICENSE). It includes\ndata derived from the Unicode Character Database; the required\nattribution is in [ NOTICE](/studiohaze/topaz/blob/main/NOTICE).", "url": "https://wpnews.pro/news/show-hn-topaz-a-small-unicode-first-language-that-compiles-to-rust", "canonical_source": "https://github.com/studiohaze/topaz", "published_at": "2026-06-16 06:30:22+00:00", "updated_at": "2026-06-16 06:48:54.337946+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Topaz", "Rust", "GitHub", "Studio Haze"], "alternates": {"html": "https://wpnews.pro/news/show-hn-topaz-a-small-unicode-first-language-that-compiles-to-rust", "markdown": "https://wpnews.pro/news/show-hn-topaz-a-small-unicode-first-language-that-compiles-to-rust.md", "text": "https://wpnews.pro/news/show-hn-topaz-a-small-unicode-first-language-that-compiles-to-rust.txt", "jsonld": "https://wpnews.pro/news/show-hn-topaz-a-small-unicode-first-language-that-compiles-to-rust.jsonld"}}