Node.js rethought for Lua.

Emilua is a cross-platform runtime for LuaJIT programs. It gives you networking, files, timers, processes, and concurrent execution in one place—roughly the role Node.js plays for JavaScript.

The similarity is about the job, not the API. Emilua uses fibers instead of promise-shaped concurrency, gives you control over how independent Lua VMs use threads, and makes process authority programmable.

Untrusted image in. Decoded pixels out. Nothing else.

An image decoder gets the file you selected—not every file you own. A trusted host opens that file read-only and hands it to a separate process. Qt parses the bytes there. The host never invokes the image parser.

The worker returns a small framebuffer description and a sealed memory descriptor. Emilua validates the result before the UI displays it. No general filesystem or network access is part of the deal.

The Emilua mascot used as the decoder's test image
The actual test input. The example decodes this PNG in a separate process and checks its dimensions and framebuffer format.
  1. Trusted hostOpens only the selected image, read-only.
  2. Sandboxed workerReceives that descriptor and a reply channel, then calls Qt.
  3. Trusted hostValidates and displays the framebuffer—not attacker-controlled pointers.

One runtime, several boundaries

Fibers share a Lua VM. Actors give you independent VMs and message passing. Subprocess actors add operating-system isolation. You can choose the boundary that fits the problem instead of forcing every application into one concurrency or threading policy.

Compare fibers, actors, and subprocesses, including their memory and authority models.

Back-pressure remains your policy

Emilua exposes small, composable read and write operations rather than hiding an implicit write buffer behind them. Choose the queueing, batching, and cancellation policies that fit your protocol.

TCP, UDP, TLS, DNS, files, pipes, serial ports, clocks, timers, and filesystem operations use portable interfaces backed by native operating-system facilities.

Know what you are getting

Emilua targets Windows, Linux, and FreeBSD, subject to LuaJIT architecture support. Portable I/O does not make OS-specific sandboxing APIs identical on every system. The image-decoding example is not available on Windows.

Emilua is not a Node.js compatibility layer, a web framework, or just a container tool. The examples on this site are teaching code, not a claim that every policy is production-ready. Read the current limitations before reusing them.