Easier for AI to get right
Rust-shaped blocks, functions, structs, and `impl` give code a skeleton. Removing borrow checking and explicit `mut` makes generation and human editing more direct.
The dynamic language for AI-native software
Zust is a dynamic runtime language for agents, toolchains, and host systems: structured like Rust, hot-swappable like a script, and able to move toward Cranelift JIT, native host functions, and GPU backends.
pub fn agent_task(ctx) {
let plan = ctx.goal;
let tools = root::get("local/tools");
for step in plan.steps {
let result = tools[step.tool](step.input);
ctx.memory.push(result);
}
ctx.memory
}
Why AI needs a new scripting layer
As agents generate workflows, data transforms, tool calls, and compute kernels in real time, the old write-compile-deploy loop becomes too rigid. Zust turns AI-generated intent into scripts that can be reviewed, hot-swapped, evolved, and compiled into native functions when performance matters.
Rust-shaped blocks, functions, structs, and `impl` give code a skeleton. Removing borrow checking and explicit `mut` makes generation and human editing more direct.
`Dynamic` covers maps, lists, bytes, typed vectors, JSON, and MessagePack. Agent context, tool results, and external API payloads can enter the runtime naturally.
`zust-vm` compiles modules with Cranelift and hands function pointers to host Rust. Start dynamic, then accelerate the paths that become important.
The same language surface is used for CPU JIT, SPIR-V, Metal, and Vulkan experiments. AI can generate not only business logic, but inspectable computation.
AI-native runtime layer
Zust aims to be the controllable language layer in the middle: more expressive than JSON workflows, more hot-swappable than a full systems language, and more durable than one-off prompts.
Open source on GitHub
The parser, compiler, VM, Dynamic model, GPU backends, LSP, and example scripts live in one workspace. Clone it, run it, inspect the implementation, or embed it in your own Rust system.
Language overview
`.zs` files support functions, generics, structs, `impl`, closures, imports, pattern bindings, expression-oriented control flow, loops, and compound assignment. The goal is compact scripts that still have a maintainable shape.
struct Point {
x: f64,
y: f64,
}
impl Point {
pub fn len2(self: Point) {
self.x * self.x + self.y * self.y
}
}
pub fn demo() {
let p = Point{x: 3.0, y: 4.0};
p.len2()
}
Runtime and backends
The workspace includes parser, compiler, VM, root, llm, SPIR-V, Metal, Vulkan, LSP, and editor integrations. Zust can be a scripting layer inside Rust apps or a high-level description for compute kernels.
pub struct BigFloat<N> {
sign: bool,
exp: i32,
data: [u32; N],
}
impl BigFloat<N> {
pub fn zero() {
BigFloat<N>{
sign: false,
exp: 0,
data: [0u32; N],
}
}
pub fn add(self: BigFloat<N>, rhs: BigFloat<N>) {
// same script shape, CPU JIT or GPU backend
bigfloat_add(self, rhs)
}
}
Hand-written lexical analysis, recursive descent parsing, AST-to-IR compilation, symbol tables, and type inference.
Cranelift JIT, dynamic value model, addressable object tree, and storage abstraction.
GPU backends for SPIR-V generation, Metal source generation, and Vulkan dispatch.
Generic model-call helpers, `.zs` language server, and Zed editor extension.
Quick start
The minimal flow imports source code, requests a compiled function pointer, and calls it as a native function. See `vm/examples/minimal_vm.rs` in the repository.
cargo check --workspace
cargo run -p vm --example minimal_vm
cargo run -p zusts