Vectrune language and runtime map
Find Vectrune documentation for language syntax, builtins, shared memory, frontend apps, CLI tools, and Pixel game runtimes.
Core language and builtins
Rune documents combine @Section paths, key/value data, records, and ordered run steps. The CLI also supports .vect and .vectrune script workflows. Flow control includes conditional if/else blocks and structured match or switch statements that evaluate single branches.
The existing builtin catalog is a starter reference, not a complete inventory. Runtime availability differs between the native CLI, browser emulator, WebAssembly, and frontend JavaScript; check the implementation before assuming a builtin is portable.
Look up a matching object
Use items[]id to find the first item whose id matches the current id binding. The ?? operator gives a fallback when the lookup finds no match.
#!RUNE
@App
name = Matching lookup with fallback
type = REST
@Route/GET/items/{id}
run:
items = [{ id: "intro", title: "Introduction" }]
item = items[]id ?? null
respond 200 { item: item }
vectrune check examples/language/matching_lookup_fallback.rune --deny-warningsBuild and test an add-on
Run these commands from the consuming project. A local package directory supplies its manifest and live Rune files. For a direct native library install, pass the package manifest and approve the library during installation.
Use --global for the user-wide tool scope. Local links and approvals stay outside the project manifest and lockfile.
The add-on authoring guide walks through vectrune.toml, dependency aliases, and the C ABI v1 lifecycle. Its downloadable Echo package shows how [native.tool] turns a package alias into a local CLI command.
vectrune deps install ../my-addon
vectrune deps install ../libsender.dylib --manifest ../sender/vectrune.toml --global
vectrune deps global list
vectrune deps global remove senderWrap a CLI as a package command
Use [command] for an installed alias that launches a specific executable. Each manifest slot becomes one argument. The operator approves the executable, argument layout, timeout, and combined output limit.
vectrune deps install ../print-message
vectrune command approve print-message /usr/bin/printf
vectrune print-message --message "Hello from an add-on"Read-only list constants
Declare arrays in a top-level @Values section to use them as read-only lists in native Rune handlers. Enclose the array in quotes to keep its source text as a string.
#!RUNE
@App
name = List constants
type = REST
@Values
points = [1, 2]
levels = [
{"name":"intro","badges":["first"],"visible":true},
{"name":"review","badges":[],"visible":false}
]
empty = []
literal_text = "[1,2]"
@Route/GET/values
run:
respond 200 { points: points, levels: levels, empty: empty, literal: literal_text }
Web interfaces and deployment
Rune-Web is a frontend mode mounted through @Frontend on a REST app. Static hosting, dynamic AI sites, and Lambda packaging are separate parts of the runtime surface.
In Rune-Web, @Navigator can bind the active route and a separate section fragment. Use fragment = activeSection with mode = path or mode = query to share links such as /#quickstart and restore the selected section on refresh or Back and Forward.
Pixel games and Vect Breach
Vect Breach demonstrates the pixel-3d app type with runtime = hybrid. Its entry file imports controls, title scenes, assets, guards, maps, sound, and game logic. @Scene connects those definitions to the camera, things, weapon, HUD, and input controls.
Neon Circuit uses live voxel camera state for its boss finish. It renders the existing platforms around a hinge and draws the original scenery from a side-on camera beneath the glass. Model pitch animates Axel’s somersault. After a Master Robot, the camera descends toward Axel and a fade reveals his first-person view of the glass deck. The scene’s weapon binding and HUD reticle show where he is aiming. A sound attack builds the glass lift’s hum, and music.play with a fade duration blends the victory fanfare into the escape score at landing. The lights binding colors nearby floors, walls, and models in the shared Pixel 3D renderer. Neon Circuit binds a separate set for its title scene and changes its robot-preview lighting as the player browses sectors. Its side-map legend uses center_voxel to give a four-tile platform a two-tile walking lane. Its floating HUD countdown shows the time remaining on the escape route and pulses red during the final ten seconds.
The Master Gate reads recovered cores from the existing campaign save. The cabinet's Super Code is a data-pixel-action form that submits one record of named text fields to the game. The finale sequences voxel rooms with side, miniature, overhead, and first-person cameras while the same music track continues playing.
Neon Circuit's select data-pixel-lighting control enables Enhanced lighting at the selected resolution. Model metadata marks emissive palette colors, glass panes, and contact shadow radii for the CPU renderer.