Docs
First program
Minimal runnable shape and xo commands. Build the toolchain first via /install.
Program
/ std/io
$ xs = [1, 2, 3]
~ sum = 0
* x : xs {
~ sum = sum + x
}
io.print("sum={sum}")Read it
Top-level statements run in order. No reserved entry function is required. / std/io binds module io. io.print writes a string. The list is walked by * x : xs, and the mutable accumulator is updated with ~. Userland printing goes through std; there is no free global print.
Commands
cargo build -p xo
./target/debug/xo check examples/misc/sum_list.echo
./target/debug/xo run examples/misc/sum_list.echo
./target/debug/xo run --jit examples/misc/sum_list.echo
./target/debug/xo build examples/misc/sum_list.echo -o /tmp/sum-list
/tmp/sum-list
Next steps
Open /try to check this program and capture io.print. Build xo via /install when you still need the toolchain. Project setup starts a new directory. Learn the statement glyphs on Leaders, then continue through binds, values, and collections. Spec TOC: /e26/spec. Narrative chapters live under /book.