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.

Ownership you can read.

A transaction must finish. A borrow names its fields. A function declares its effects. These rules live in the language.

VThe language in code
The resource contract

linear means exactly once.
Every path must consume the value.

CreateUseConsume
transaction.ves
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

Native code and Lean proofs.

  1. Check the resource contract

    Modes, effect rows and place capabilities establish who owns each value and which fields a function can change.

    Front end
    01Lossless syntax.ves → CST → HIR
    02Ownership and effectscopy ⊑ affine ⊑ linear
    03Place capability graphbroker.index ⊥ broker.config
  2. Optimize with effect evidence

    Effect-aware equality saturation uses the program’s ownership and disjointness information to guide rewrites.

    Optimization
    04Typed Place IRExplicit state and effect tokens
    ↔Equality saturationegglog · rewrite witnesses
    ↓Evidence-preserving loweringResource and aliasing constraints
  3. Choose native execution or verification

    Compile through Cranelift or the verified backend. Extract state-passing Lean 4 definitions for functional correctness proofs.

    Backends
    05One checked programOptimized Place IR
    NativeCranelift /
    verified codegen
    Lean 4Definitions /
    proof certificates

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
Build and run
# 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