Skip to content

The 5-minute tour

After Install:

Terminal window
vow new quick-demo && cd quick-demo
vow run src/main.vow
echo $? # 0 — scaffold prints "Hello from Vow!"

To try a numeric exit code instead, edit src/main.vow:

fn main(caps: Caps) -> int {
return 1 + 2
}
Terminal window
vow build src/main.vow -o quick-demo
./quick-demo; echo $? # 3
fn unwrap_or(opt: Option<int>, fallback: int) -> int {
return match opt {
Some(x) => x,
None => fallback
}
}

Structs, enums, exhaustive match, static interfaces — see Types.

fn withdraw(balance: int, amount: int) -> int
requires amount > 0
requires amount <= balance
ensures result >= 0
{
return balance - amount
}

Runtime checks only — Contracts. Try with tests/lang/withdraw.vow in a repo clone.

fn main(caps: Caps) -> int {
return match caps.fs_read {
Some(cap) => with cap {
match read_file("/tmp/vow_poc.txt") {
Ok(s) => len(s),
Err(_) => 0 - 1
}
},
None => 0 - 1
}
}

Requires a clone (or your own file) plus a grant at run time:

Terminal window
vow run tests/lang/caps_poc.vow -- --grant fs-read:/tmp

Or with needs / with sugar — Capabilities.

// fragment-only
var c = new Counter(0)
let tag = if age >= 18 { "adult" } else { "minor" }
let area = switch s {
case Circle(r): 3 * r * r,
case Rect(w, h): w * h,
}
for i in 0..n { total = total + i }
let evens = array_filter(xs, (x) -> x % 2 == 0)
print("${name}: ${tag}")
let d = maybe ?? 0
let v = try fallible(true) catch (e) { e }
  1. Tutorial — full use-case path (recommended next)
  2. Syntax ergonomicsnew / switch / try
  3. Limitations — API confinement ≠ OS sandbox
  4. Changelog — release notes
  5. Syntax — language reference hub