Guide
REPL
Explore Echo through the shared compiler pipeline and in-process LLVM JIT.
Start a session
xo repl
The REPL uses the same parser, semantic analysis, LLVM lowering, and runtime as xo run --jit. Successful statements persist in the session and are compiled again with later input.
Evaluate and retain
$ x = 40
x + 2
/ std/io
io.print('hello from the repl')Bare expressions auto-display for ints, floats, bools, strings, and several heap shapes via str.from_debug. Other kinds use io.print or str.from_*. Bindings, imports, structs, tasks, and other successful statements remain in the session until it is cleared. A + spawn is kept even when it exits unjoined so a later - can complete the pair.
Multi-line input
Keep a block’s opening brace unmatched to continue on the next prompt. Evaluation begins when brace depth returns to zero.
$ double = (value) {
^ value + value
}
double(21)Session commands
:help # show help
:session # print accumulated Echo source
:clear # clear accumulated source
:quit # leave (:exit and Ctrl-D also work)
Interactive history is stored under $XDG_STATE_HOME/xo/history or ~/.local/state/xo/history. End-of-line hints preview integer expressions and complete meta commands or matching history entries.
Piped input
printf '%s
' '$ x = 1' 'x + 2' ':quit' | xo repl
When standard input is not a terminal, the REPL reads line-oriented input without the interactive editor. This is useful for reproducible smoke checks.