Skip to content

Types

Vow has no null. Optional and fallible values use Option and Result from the prelude.

Type Notes
int Default integer width on the native path
int64 Wider integer; no implicit mix with int — use as
f32 / f64 Floats + casts (phase2_collections.vow)
bool true / false
String Heap string; len(s), concat, trim/replace/split/join
Array<T> Index, .len(), array_push, index assign, for x in xs
Map<String, V> String keys only (v1); map_new / map_get / map_set / len
// fragment-only
let wide = n as int64;
let ratio = 0.5 as f64;

classstruct. Enums construct with Shape::Circle(2); match patterns use bare variants (Circle(r), not Shape::Circle(r)). Matches must be exhaustive.

Single inheritance ships: open class / extends / mandatory override (inheritance.vow). Dispatch is static.

// fragment-only
fn total_area(shapes: Array<dyn Shape>) -> int {
var sum = 0;
for s in shapes {
sum = sum + s.area();
}
return sum;
}

Static interface parameters are monomorphized. Heterogeneous collections use dyn Interface + vtables (tests/lang/dyn_shapes.vow in a repo clone).

// fragment-only
type Score = int;
fn double(x: int) -> int { return x * 2; }
let ys = array_map(xs, double);
let zs = array_map(xs, (x: int) -> x * 3);
let evens = array_filter(xs, is_even);

Opaque: FsRead, FsWrite, Net, Env, Clock, Rand, Proc, Threads, and the bundle Caps.