A language for systems developers
Memory safety without a garbage collector. Resources, effects and mutation are explicit in the code you write.
Native compilation. Lean 4 verification.
linear struct WriteTxn {
wal_slot: u64
}
fn commit(sink tx: WriteTxn) {
let WriteTxn { wal_slot } = tx;
}
linear struct WriteTxn {
wal_slot: u64
}
impl WriteTxn {
fn commit(sink self) -> u64 {
let WriteTxn { wal_slot } = self;
wal_slot
}
fn abort(sink self) {
let WriteTxn { wal_slot } = self;
}
}
inout broker.{
index, metrics
}eff [Storage,
Fail[IoError]
]Ownership you can read.
A transaction must finish. A borrow names its fields. A function declares its effects. These rules live in the language.
linear means exactly once.
Every path must consume the value.
linear struct WriteTxn {
wal_slot: u64
}
impl WriteTxn {
fn commit(sink self) -> u64 {
let WriteTxn { wal_slot } = self;
wal_slot
}
fn abort(sink self) {
let WriteTxn { wal_slot } = self;
}
}
fn main() -> u64 {
let tx = WriteTxn { wal_slot: 42 };
tx.commit()
}
Download source
copy struct Broker {
index: u64,
metrics: u64,
config: u64
}
// A checked failure may not abort across an inout parameter, so these
// counters are explicitly modular.
fn append(inout broker.{index, metrics}: Broker, in config: u64) {
broker.index = wrapping_add(broker.index, config);
broker.metrics = wrapping_add(broker.metrics, 1);
}
fn main() -> u64 {
let broker = Broker {
index: 1,
metrics: 0,
config: 41
};
append(inout broker, in broker.config);
broker.index
}
Download source
fn divide(divisor: i64) -> i64 eff [Fail[RuntimeError]] {
84 / divisor
}
fn main() -> i64 {
handle Fail[RuntimeError] in {
divide(0)
} with {
return value => value,
raise(error, _) => match error {
RuntimeError::DivisionByZero => 42,
RuntimeError::IndexOutOfBounds => 0,
},
}
}
Download source
Native code and Lean proofs.
-
Check the resource contract
Modes, effect rows and place capabilities establish who owns each value and which fields a function can change.
Front end01Lossless syntax.ves → CST → HIR02Ownership and effectscopy ⊑ affine ⊑ linear03Place capability graphbroker.index ⊥ broker.config -
Optimize with effect evidence
Effect-aware equality saturation uses the program’s ownership and disjointness information to guide rewrites.
Optimization04Typed Place IRExplicit state and effect tokens↔Equality saturationegglog · rewrite witnesses↓Evidence-preserving loweringResource and aliasing constraints -
Choose native execution or verification
Compile through Cranelift or the verified backend. Extract state-passing Lean 4 definitions for functional correctness proofs.
Backends05One checked programOptimized Place IRNativeCranelift /
verified codegenLean 4Definitions /
proof certificates
A language for whole systems.
The same ownership and capability model extends from network buffers and database pages to native interfaces, GPU work and your build.
linear UmemFrameReceive → Process → RecycleWeb and networking
Prism and Warp pair protocol handling with linear buffer ownership.
Tensor[r, DType, Shape]Quarry / Tensor / FluxData and compute
Typed queries, shape-checked tensors and incremental stream processing.
eff [UiThread]Aura / Ignis / KineticNative applications
Native interfaces, graphics and deterministic physics share explicit capabilities.
capability_ceiling = []Loom / Lens / Stylus / CodexTooling and supply chain
One CLI brings sandboxed builds, capability budgets, tooling and verification together.
Start with the source.
Build the compiler, check a program, then run it. The repository holds the language, its tools, examples and formal foundations.
copy- Use a value more than once.
affine- Use it at most once, with scope-exit cleanup.
linear- Consume it exactly once on every control-flow path.
The design carries these contracts through effects, concurrency and verification.
Read the programs# Requires the Rust toolchain
git clone https://github.com/robot-head/vesper.git
cd vesper
cargo build --release -p vesper
# Check types, effects and ownership
./target/release/vesper check \
examples/transaction.ves
# Execute with the reference evaluator
./target/release/vesper run \
examples/transaction.ves
# Inspect IR and extract Lean definitions
./target/release/vesper emit \
examples/transaction.ves --emit ir
./target/release/vesper emit \
examples/transaction.ves --emit lean
View the repository