01 / Prepare
Build the tools
Clone Ziran and build the tools. You need a C compiler and make. Go is needed only to run generated Go output. ziran version prints the version you built; the latest release is v0.4.2.
git clone https://github.com/ziranlang/ziran.git
cd ziran
make
make install-userAdd ~/.local/bin to your PATH. The commands below use the installed tools.
02 / Source
Write a module
Save this as hello.zi. A source file is a module named after its filename.
main :: () {
print("Hello, World!\n");
}print substitutes each % in its format with the next argument, so print("Hello, %!\n", name) greets any name. Write %% for a percent sign.
03 / Run
One command.
ziran run hello.zi
# Hello, World!Ziran checks the source and runs main. You can also use zi2zx hello.zi.
04 / Native output
Run native code
ziran run --target=c hello.ziCompile and run through C with the same result. See the compiler guide for saving C, Go, checked IR, or portable programs.
Keep going
Follow the source contract
ziran.toml, dependencies, locks, and ziran install ↗Language directionSyntax, laws, evolution, and planned parallel execution ↗Implementation statusWhat the current compiler actually supports ↗