u/ianm818

OmniLua - Rust implementation of Lua 5.1 - 5.5 targeting web use and sandboxing
▲ 0 r/lua

OmniLua - Rust implementation of Lua 5.1 - 5.5 targeting web use and sandboxing

[Github here] (https://github.com/ianm199/omnilua/tree/main)

Website + docs

I've been working on OmniLua for a bit now - it builds one binary that can run Lua 5.1 - 5.5 from one binary.

The main motivation for this was there seemed to be a gap for game development in the Rust community where mlua cannot be run in the browser, so games built in engines like bevy can't compile to wasm32-unknown-unknown.

There is some other benefits - like being able to easily use Lua in Cloudflare workers or in "playground" developer tools.

Highlights:

  • Targets 100% conformance to reference Lua for all 5 versions
  • Can run LuaRocks and install Lua only packages
  • Performance is slower than C Lua 5.4.7 but within ~40% on standard benchmarks. Performance chart here
  • API is 100% compatibile with mlua

Try it:

cargo install omnilua-cli

export OMNILUA_VERSION=5.5

omnilua -e 'print("hello")'

omnilua # opens repl

I used AI heavily to develop this I wouldn't consider it "vibecoded" however.

u/ianm818 — 7 days ago
▲ 6 r/lua

lua-rs: Lua 5.4.7 implemented from scratch in Rust - passes upstream Lua C test suite fully

Github: https://github.com/ianm199/lua-rs/tree/main

Highlights:

  • Passes full upstream tests
  • Performance is near parity with C checkout dashboard here on optimization. Table ops seem to be much faster
  • Has GC, VM, and supports all Lua sytnax. Any pure lua script should run
  • Limited unsafe calls - mostly just in the GC for now

My motivation here was that in the long run we want the core internet utilities to run on memory safe languages, big ones like redis and nginx expose scripting via Lua so if we really want to replace core infra fully in Rust, you'd need a full Rust Lua that doesn't bundle C. After that you should be able to i.e. build drop in replacements for those without a C ABI (or that's part of the way there).

Long term goals:

  • Get to stable, production ready
  • Get performance at parity or faster then Lua C
  • Replace current unsafe GC with fully safe if possible
  • (Maybe) support Lua 5.1, LuaJIT
reddit.com
u/ianm818 — 1 month ago
▲ 45 r/rust

lua-rs: Lua 5.4.7 reimplemented in (mostly) safe Rust - passes the official PUC-Rio test suite

Github: https://github.com/ianm199/lua-rs/tree/main

Highlights:

  • Passes full upstream tests
  • Performance is near parity with C checkout dashboard here on optimization. Table ops seem to be much faster
  • Has GC, VM, and supports all Lua sytnax. Any pure lua script should run
  • Limited unsafe calls - mostly just in the GC for now

My motivation here was that in the long run we want the core internet utilities to run on memory safe languages, big ones like redis and nginx expose scripting via Lua so if we really want to replace core infra fully in Rust, you'd need a full Rust Lua that doesn't bundle C. After that you should be able to i.e. build drop in replacements for those without a C ABI (or that's part of the way there).

Long term goals:

  • Get to stable, production ready
  • Get performance at parity or faster then Lua C
  • Replace current unsafe GC with fully safe if possible
  • (Maybe) support Lua 5.1, LuaJIT

First major project in Rust - would love feedback!

reddit.com
u/ianm818 — 1 month ago

I'm much more sympathetic towards Anthropic than most users here. Started using CC when it was barely useable and think they are the good guys dealing with a real supply crunch.

But every session I get prompted a dozen times to /schedule random tasks for two weeks in advance. Even small features "Want me to /schedule a check in for 2 weeks when this is live"?

I realize they are tryign to scale to $100b in a year... they should focus on the product not shilling

reddit.com
u/ianm818 — 2 months ago