Ziran
Ziran is a general-purpose language with direct native, WebAssembly, portable ZX, C and Go output. Master includes Unreleased work; the current version is in VERSION and CHANGELOG.md.
Website and playground · Compiler guide · Current support
Quick start
Build with Make, a C11 compiler and GNU binutils:
make
build/bin/ziran check examples/hello.zi
build/bin/ziran run examples/hello.zi
build/bin/ziran build examples/hello.zi
run checks and executes main; build defaults to a direct native binary.
make install-user installs the tools in ~/.local/bin.
The same check, ir, build and run workflow handles .zi, .ts and
.tsx sources together; ziran ir --project -o build/ir saves their common
checked IR. ts2zi checks TypeScript with Microsoft's pinned TypeScript Go
compiler (tsgo) and lowers it to Ziran source; see the
native TypeScript subset. Full TypeScript
semantics through that path is the roadmap's flagship milestone; see the
target architecture.
main :: () { print("Hello, World!\n") }
Tools
Source → ZIR → LIR → optimized LIR → ZX → native (ELF/PE, x86-64/AArch64/ARMv7).
WebAssembly lowers from verified ZX through zx2wasm; C and Go export from ZIR
through zi2c and zi2go, and TypeScript through zi2ts.
| Command | Purpose |
|---|---|
check |
Validate source and imports. |
build |
Build native output, or select --target=c, go, wasm or zx. |
ir / inspect |
Save checked .zir modules and inspect artifacts. |
bundle / run |
Link .zx executables and run source or ZX. |
learn |
Control native-build corpus recording and offline C-teacher verification/training. |
fmt |
Format source. |
guide / features / capabilities |
Query syntax and target limits. |
api |
Query checked public declarations. |
Safety is manual by default, as in C. --checks opts a build into runtime
checks; #checks keeps bounds checks in selected source regions. See
checks for target-specific behavior.
Documentation
| Read | When you need |
|---|---|
| docs/USAGE.md | The compiler and standard library guide |
| docs/IMPLEMENTATION_STATUS.md | Supported targets and limits |
| docs/PACKAGES.md | Packages, projects, and lock files |
| docs/NATIVE_TYPESCRIPT.md | Native .ts / .tsx syntax, imports, current limits and the full-project roadmap |
| docs/ARCHITECTURE.md | The compiler pipeline and the target architecture (roadmap) |
| docs/LANGUAGE_DIRECTION.md | Language syntax and directives |
| docs/OWNED_VALUES.md | Owned values and recoverable failures |
| docs/DIAGNOSTICS.md | Diagnostic codes and JSON output |
| docs/AUTHORING.md | Tool-driven editing workflows |
| docs/LAWS.md | Laws and proof certificates |
| docs/ZX.md | The portable ZX format |
| bench/README.md | Running benchmarks |
| plans/open-work.md | What is still open |
Standard library and package APIs: ziran-lang.org/modules.html.
Kryon is a separate UI library imported by applications; console programs have no graphics dependency. Repository rules for agents live in AGENTS.md.
Development
Run make check for the retained local suite and make check-bootstrap for
bootstrap reproducibility. CHECK_FILTER=text selects matching tests. The
compiler uses maintained Ziran and C sources; bootstrap seeds live in
bootstrap/. Refresh affected seeds with make update-bootstrap after
compiler changes.