Skip to content

Primitive Types

Vertex has eight built-in types:

TypeLiteralExample
Intplain integer42
Longinteger with L suffix100L
Doubledecimal point, no suffix3.14
Decimaldecimal with d suffix9.99d
Booltrue or falsetrue
Stringdouble-quoted"hello"
Idno literal. Comes from Salesforce DML,
Voidthe keyword VoidVoid
let age: Int = 30
let population: Long = 8000000000L
let price: Decimal = 19.99d
let ratio: Double = 0.75
debug age + 5 // 35
debug price * 2.0d // 39.98

Strings use double quotes and support interpolation:

let name = "Alice"
let age = 30
debug "Hello, ${name}! You are ${age} years old."

Any expression is valid inside ${}:

debug "${2 + 2}" // 4
debug "area: ${3.14 * 5.0 * 5.0}"

String + coerces the right-hand side automatically:

debug "count: " + 42 // "count: 42"

Void is a first-class value. Not just an absence of a return type. A function that only performs side effects declares : Void and ends with Void as its last expression:

fn log(message: String): Void {
debug message
Void
}

Type annotations on local bindings are optional when the type can be inferred:

let x = 42 // Int, inferred
let y: Int = 42 // Int, explicit. Same thing