lux

Lux9 — plan 9 · posix

Lux9

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


What is Lux?

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.

Features

Language

Standard library

Hello

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;"

HTTP server

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/.

Templates and Markdown

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*.");

Install

git clone https://github.com/thecount12/lux.git
cd lux

macOS / Linux

cd posix
make
./lux ../examples/demo.lux

OpenBSDgmake instead of make.

Plan 9

mk
./8.out examples/demo.lux

Optional database drivers and platform notes: BUILD.md.

Cloud

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.

Docs

The full language reference, HTTP server notes, and examples live in the GitHub README.