Walrus

Walrus

Overview of Walrus as a compact embeddable language for gameplay code, tools, and VM-driven scripting.

Updated April 13, 20263 min readWalrus / Overview

Walrus is an embeddable scripting language aimed at gameplay code, tools, and runtime extension points. The language stays deliberately small: readable source, predictable value movement, and a VM the host application can drive directly.

The docs tree focuses on the language shape that exists today:

  • colon-and-indentation blocks
  • typed functions and locals
  • arrays, maps, enums, classes, and generics
  • closures and captured values
  • explicit ownership features like ref, mut ref, and shared<T>

Walrus source files use .wlrs and follow colon-delimited syntax:

Walrus
module Showcase
@strict
import Math

let Pi = 3.1415926

fn makeAdder(k: int) -> fn(int) -> int:
    fn add(x: int) -> int:
        return x + k
    return add

fn main() -> int:
    let values = [1, 2, 3]
    let state = { x = 1, message = "hi" }
    let add7 = makeAdder(7)

    values[1] += 10
    state.x += 5

    if values[1] == 12 && add7(5) == 12:
        return 1
    return 0

If you are starting fresh, read Syntax, Variables, and Functions first. If you are working close to engine memory or host objects, read Ownership early because that page explains how values move, borrow, and clean up.