Skip to content

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.

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
A typical Lua process has a baseline memory overhead of ~13 KB.
local pid = process.spawn("app.workers:handler", "app:processes")
process.send(pid, "task", {data = "work"})

See Process Management for spawning, linking, and supervision.

Go-style channels for communication:

local ch = channel.new() -- unbuffered
local buffered = channel.new(10)
ch:send(value) -- blocks until received
local val, ok = ch:receive() -- blocks until ready

See Channels for select and patterns.

Within a process, spawn lightweight coroutines:

coroutine.spawn(function()
local data = fetch_data()
ch:send(data)
end)
do_other_work() -- continues immediately

Spawned coroutines are scheduler-managed—no manual yield/resume.

Handle multiple event sources:

local r = channel.select {
inbox:case_receive(),
events:case_receive(),
timeout:case_receive()
}
if r.channel == timeout then
-- timed out
elseif r.channel == events then
handle_event(r.value)
else
handle_message(r.value)
end

These are always available without require and don’t need to be listed in modules::

  • process - spawn, message, monitor, and link processes
  • channel - Go-style channels
  • payload - the entry’s input payload
  • print, subscribe, unsubscribe - logging and pub/sub
  • os, table, math, string, coroutine, errors - standard libraries

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.

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.

Functions return result, error pairs:

local data, err = json.decode(input)
if err then
return nil, errors.wrap(err, "decode failed")
end

See Error Handling for patterns.