A Lox-family scripting language for system automation, HTTP services, and cloud work. Native on Plan 9, same runtime on macOS, Linux, and OpenBSD.
Not the JVM Lisp at LuxLang/lux, and not the Lux9 microkernel. Scripts are still .lux; the command is still lux.
View on GitHub · Download v1.1.0 · README · lux9.dev
Lux started as a Plan 9 port of Lox and grew into a small bytecode interpreter with a real standard library: files, JSON, HTTP client and server, templates, Markdown, databases, and AWS. It compiles with mk/8c on Plan 9 and make on POSIX.
Language
import "path.lux"Standard library
httpGet / httpPost / httpPut / httpRequest) and Server (routes, static files, virtual hosts, middleware, prefork workers)renderTemplate ({{ }}, {% for %}, {% include %}, {% include_md %})markdownToHtml and renderMarkdownput / get / has / remove / iterluxfmt, luxtest, luxcheck, luxlintargs(), exit(), typeof(), run()print "Hello, Lux!";
fun fib(n) {
if (n < 2) return n;
return fib(n - 2) + fib(n - 1);
}
print fib(10); // 55
./lux -c "print 1 + 2;"
Routes, static files, virtual hosts, middleware, and prefork workers — Plan 9 and POSIX.
fun handleHello(req, res) { res.send("Hello from Lux!"); }
var server = Server(8080);
server.workers(4);
server.get("/hello", handleHello);
server.static("public");
server.start();
var res = httpGet("https://fakestoreapi.com/products/1");
if (res != nil) {
var data = parseJSON(res);
print data.title;
}
See examples/server_middleware.lux, examples/vhost_server.lux, and examples/template_server/.
class TplCtx {
init(title, items) {
this.title = title;
this.items = items;
}
}
var html = renderTemplate("public/index.tpl", TplCtx("Hi", ["a", "b"]));
res.html(html);
var html = markdownToHtml("# Hi\n\nHello *world*.");
git clone https://github.com/thecount12/lux.git
cd lux
macOS / Linux
cd posix
make
./lux ../examples/demo.lux
OpenBSD — gmake instead of make.
Plan 9
mk
./8.out examples/demo.lux
Optional database drivers and platform notes: BUILD.md.
Small footprint, HTTPS client, and native AWS helpers (S3, STS, IAM, request signing). Use it for scripts, Lambda-style jobs, or CI — not as a heavy numerical runtime.
The full language reference, HTTP server notes, and examples live in the GitHub README.