Lua Runtime
Lua Runtime
Section titled “Lua Runtime”Wippy’s primary compute runtime optimized for I/O-bound and business logic workloads. Code runs in isolated processes that communicate through message passing—no shared memory, no locks.
Wippy is designed as a polyglot runtime. While Lua is the primary language, future versions will support additional languages through WebAssembly and Temporal integration for compute-intensive or specialized workloads.
Processes
Section titled “Processes”Your Lua code runs inside processes—isolated execution contexts managed by the scheduler. Each process:
- Has its own memory space
- Yields on blocking operations (I/O, channels)
- Can be monitored and supervised
- Scales to thousands per machine
local pid = process.spawn("app.workers:handler", "app:processes")process.send(pid, "task", {data = "work"})See Process Management for spawning, linking, and supervision.
Channels
Section titled “Channels”Go-style channels for communication:
local ch = channel.new() -- unbufferedlocal buffered = channel.new(10)
ch:send(value) -- blocks until receivedlocal val, ok = ch:receive() -- blocks until readySee Channels for select and patterns.
Coroutines
Section titled “Coroutines”Within a process, spawn lightweight coroutines:
coroutine.spawn(function() local data = fetch_data() ch:send(data)end)
do_other_work() -- continues immediatelySpawned coroutines are scheduler-managed—no manual yield/resume.
Select
Section titled “Select”Handle multiple event sources:
local r = channel.select { inbox:case_receive(), events:case_receive(), timeout:case_receive()}
if r.channel == timeout then -- timed outelseif r.channel == events then handle_event(r.value)else handle_message(r.value)endGlobals
Section titled “Globals”These are always available without require and don’t need to be listed in modules::
process- spawn, message, monitor, and link processeschannel- Go-style channelspayload- the entry’s input payloadprint,subscribe,unsubscribe- logging and pub/subos,table,math,string,coroutine,errors- standard libraries
Modules
Section titled “Modules”Everything else is loaded with require() and must appear in the entry’s modules: allowlist:
local json = require("json")local sql = require("sql")local http = require("http_client")Available modules depend on entry configuration. See Entry Definitions.
External Libraries
Section titled “External Libraries”Wippy uses Lua 5.3 syntax with a gradual type system inspired by Luau. Types are first-class runtime values—callable for validation, passable as arguments, and introspectable—replacing the need for schema libraries like Zod or Pydantic.
External Lua libraries (LuaRocks, etc.) are not supported. The runtime provides its own module system with built-in extensions for I/O, networking, and system integration.
For custom extensions, see Modules in the internals documentation.
Error Handling
Section titled “Error Handling”Functions return result, error pairs:
local data, err = json.decode(input)if err then return nil, errors.wrap(err, "decode failed")endSee Error Handling for patterns.
What’s Next
Section titled “What’s Next”- Entry Definitions - Configure entry points
- Channels - Channel patterns
- Process Management - Spawning and supervision
- Functions - Cross-process calls