Zoxi is a small language layer on top of Rust.
You write .zo files, Zoxi transpiles them into Rust under .zoxi/src, then compiles them with rustc.
Zoxi keeps normal Rust syntax unless it recognizes one of its language features.
:return syntax instead of->stringas an alias forString- owned string literals with interpolation:
"Hello, {name}" .view()asas_str()- vector literal sugar:
[1, 2, 3] - map literal sugar:
{ "name": "zoxi", "age": 1 } - index assignment sugar:
map["key"] = value - iterator helpers with arrow closures:
map,filter,find,findIndex
Example:
fn greet(name: &str): string {
"Hello, {name}!"
}
fn main() {
let nums = [1, 2, 3, 6, 8, 10];
let doubled: Vec<i32> = nums.map(x => x * 2);
println!("{} {:?}", greet("Zoxi"), doubled);
}
Write Zoxi source in src/**/*.zo:
my-app/
├── src/
│ └── main.zo
└── zoxi.toml
Generated and cached files live in .zoxi/:
.zoxi/
├── src/ # generated Rust
└── .cache/
├── transpile-state
├── build-state
├── artifacts/
└── incremental/
Shared dependency caches live globally in ~/.zoxi/cache/.
Zoxi can manage registry dependencies with:
zoxi add itertools
zoxi remove itertoolsFor user projects, Zoxi does not use Cargo at runtime.
- crate metadata is fetched from crates.io
- crate archives are downloaded directly
- dependencies are compiled with
rustc - compiled dependency artifacts are shared globally in
~/.zoxi/cache
Build:
zoxi build
zoxi build -rRun:
zoxi run
zoxi run -r
zoxi run -r -- arg1 arg2Test:
zoxi test
zoxi test -rUse --path to run against another project directory:
zoxi --path examples/hello run -rBuild the Zoxi CLI itself with Cargo:
cargo run -- --path examples/hello run -rThe Zoxi repository uses Cargo for developing Zoxi. Zoxi projects use the Zoxi runtime pipeline instead.
The CLI prints Cargo-style progress output such as:
Checking /path/to/project/src
Fresh transpilation cache (1 files)
Compiling /path/to/project/.zoxi/src/main.rs
Finished release profile [optimized]
Running /path/to/project/.zoxi/.cache/artifacts/release/app
Unchanged sources are checked through file metadata so repeated runs avoid unnecessary transpile and compile work.
Current runtime dependency support is intentionally narrow:
- registry dependencies only
- no
path,git, orworkspacedependencies - no
build.rssupport yet - proc-macro support exists but is not fully battle-tested across complex dependency graphs
See DOC.md for the current syntax reference and Rust translation details.
MIT. See LICENSE.