Guide
Project setup
Build xo, create an entry file, and establish a reliable local workflow.
Build the toolchain
Echo’s supported development baseline is Linux. Building this repository requires Rust, clang, mold, and sccache because the workspace Cargo configuration selects them directly.
git clone https://github.com/modoterra/echo.git
cd echo
cargo build -p xo
./target/debug/xo --help
The remaining examples assume the built binary is available as xo. If it is not on your PATH, replace that command with the absolute path to target/debug/xo from the checkout.
Project shape
An Echo project needs only an entry .echo file. Add sibling files or folder modules as the program grows. xo.toml is optional and only needed for pinned external dependencies.
my_app/
├── main.echo
├── config.echo
├── routes/
│ ├── health.echo
│ └── home.echo
└── xo.toml # optional
Entry file
/ std/io
$ values = [10, 20, 12]
~ total = 0
* value : values {
~ total = total + value
}
io.print("total={total}")The entry file’s top-level statements are the program body. Imports are resolved from that file into a closed module graph; no reserved main function is required.
Development loop
xo fmt --check main.echo
xo check main.echo
xo run main.echo
xo run --jit main.echo
xo build -O 2 main.echo -o my_app
./my_app
check is the fastest full-graph correctness pass. AOT run and build emit LLVM then link once with clang at -O0 -g; run --jit executes the same LLVM IR in-process.
Run from the project root
Run xo from the directory that owns xo.toml. Project compiler artifacts live under .xo/cache; downloaded packages live separately under the user root printed by xo home.