Lua runner with rich builtin stdlib
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Ondřej Hruška ec35dc911b docs 3 weeks ago
.claude add sqlite module 3 weeks ago
docs docs 3 weeks ago
lua Add info on coroutines, add task.join() 3 weeks ago
src Add info on coroutines, add task.join() 3 weeks ago
.gitignore feat: add standard library — math, table, utils, os, log 3 weeks ago
Cargo.lock Add info on coroutines, add task.join() 3 weeks ago
Cargo.toml Add info on coroutines, add task.join() 3 weeks ago
README.md add sqlite module 3 weeks ago

README.md

a

a embeds a Lua interpreter and adds a standard library and IO access, so a script can reach the network, a database, the filesystem, and the terminal without additional setup.

a file.lua

The interface is a single command: a runs the script at the given path.

What it is

a is not a Lua implementation; it embeds Lua 5.5 (via mlua) and adds the parts stock Lua omits. Plain Lua ships almost no standard library and no way to reach the outside world without C modules and a build toolchain. a provides a standard library written partly in Rust and partly in Lua, together with IO access.

The result is a single binary that runs a .lua file. There is no package manager, build step, or project scaffolding.

The standard library

The standard library is the main purpose of a. Planned surface:

  • Networking — HTTP client, WebSocket, and MQTT (3.1.1 and 5).
  • SQLite — access to embedded SQLite databases.
  • Filesystem — read/write/glob/walk without stock Lua's io boilerplate.
  • Terminal UI — interactive line editing and full-screen TUI, comparable to ncurses.

The intent is for the common case to be a single call rather than a multi-step setup.

How it works

  • Embeds Lua 5.5 via mlua, on an async core (tokio) so IO-heavy scripts don't block.
  • A single self-contained binary. No LuaRocks, no make, no virtualenv.
  • Scripts run in a sandboxed environment modeled on Luau's safe environment: io, package, and debug are not loaded; os is trimmed to its time functions; the bytecode/chunk-loading escape hatches (load, loadfile, dofile, string.dump) are removed. The library a provides is the supported way to reach the outside world.
  • A leading #! shebang line is skipped, so scripts can be made executable directly.

Building

cargo build --release
# binary at target/release/a

cargo run -- lua/test.lua   # run a script during development

Requires a Rust toolchain (2024 edition). Lua is vendored and built from source, so no system Lua is needed.