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-user

Add ~/.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.

Download hello.zi ↓

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.zi

Compile 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