r/lua • • Dec 22 '25

Lua 5.5 released

Thumbnail groups.google.com
179 Upvotes

r/lua • • Nov 17 '22

Lua in 100 seconds

Thumbnail youtu.be
218 Upvotes

r/lua • • 9h ago

Project JSL: I started optimizing Lua and accidentally built a language dialect

0 Upvotes

This entire adventure started with an obsession over Lua performance.

It has since escalated into maintaining a custom Luau dialect.

Oops.

I'm the developer of Jess, an open-source, cross-platform application runtime built on Luau, powered by a Rust binding framework called L3i.

Jess uses JSL (.jsl) as its primary scripting language. The familiar Luau foundation is still there: gradual typing, strict checking, tables, functions, and all the usual conveniences.

But I wanted to see how far we could push the language without losing the things that make Lua attractive in the first place.

And, crucially, without making it slower.

First, the boring part.

A complete Jess script looks like this:

```luau --!strict local log = require('@jess/log').new 'hello'

print(Hello from Jess {jess.version}.) log.info 'ready' ```

Run it with:

bash jess run hello.jsl

Nothing particularly exciting. It's Luau, running outside Roblox, with access to a set of native APIs, a type checker, a module system, and a CLI.

That's the baseline.

Now let's make things interesting.

Comprehensions, reducers, and generators

One of my favorite additions is Python-inspired comprehensions, with a slightly different approach to their syntax and execution.

```luau -- Filter and project local ids = [for e in entities if e.active => e.id]

-- Sum without constructing an intermediate array local mass = sum[for body in bodies => body.mass]

-- Short-circuiting boolean reduction local heavy = any[for body in bodies => body.mass > 100]

-- Pairwise iteration, requiring equal lengths local totals = [for a, b in zipStrict(xs, ys) => a + b] ```

We support nested generators, filters, range, enumerate, zipShortest, and zipStrict, along with sum, min, max, any, and all reducers.

An ordinary comprehension produces a dense, 1-based array. Reducers operate directly on the generated values without constructing intermediate tables.

The important part is how these expressions compile.

They're lowered into ordinary Luau loops.

No iterator objects. No callback per element. No intermediate arrays unless the operation actually requires one.

In our instruction-count benchmarks, the resulting loops execute extremely close to equivalent handwritten implementations. There are explicit semantic checks, such as rejecting nil projections, but we've been careful to measure their costs rather than simply assume the syntax is free.

Slices and destructuring

We've also added slicing and record patterns.

```luau -- Inclusive, 1-based slicing local sample = values[1:16]

-- Destructure a record local {x, y, z} = position

-- Rename fields local {health: hp, name} = entity

-- Nested destructuring local {transform: {position: pos, rotation}} = entity ```

Patterns work in local declarations, function parameters, and comprehension generators.

They lower to ordinary local bindings and field accesses, preserving Luau's normal indexing behavior, including metamethods.

There isn't a new object model lurking underneath this. That's intentional.

And because apparently that wasn't enough...

The dialect also supports typed buffer slices and sinks.

For example:

```luau -- Read f32 values from 16-byte records local mass = sum[for value in bodies[1:n, "f32@16"] => value]

-- Reuse an existing table as output storage into(scratch)[for x in values if x > 0 => x * 2] ```

This is particularly interesting for the kinds of workloads I've been experimenting with: processing binary formats, large datasets, game assets, and other situations where allocating thousands of temporary Lua objects isn't particularly appealing.

Certain recognized buffer reductions can even dispatch directly into L3i's native bulk-data operations instead of executing a scalar loop.

This is where the relationship between the language and the runtime starts getting interesting.

But isn't this just syntactic sugar?

In many cases, yes!

And I'm entirely comfortable with that.

The interesting engineering problem isn't necessarily inventing fundamentally new operations. It's providing convenient ways to express existing operations while preserving predictable behavior, efficient execution, and useful tooling.

JSL doesn't require a permanent fork of Luau's compiler.

Instead, L3i implements a source frontend that recognizes the extended syntax, lowers it into ordinary Luau, and maintains source mappings so diagnostics and analysis refer to the code you actually wrote.

The resulting program still goes through Luau's compiler and type checker.

That means we get to experiment with language features without maintaining an entirely separate compiler backend or type system.

It's also meant a rather absurd amount of work ensuring that the resulting code behaves exactly as intended. Evaluation order, short-circuiting, error conditions, type inference, and performance all matter.

A language feature that makes code prettier but quietly destroys performance isn't particularly attractive to me.

So why build all this?

Initially? Performance.

I started experimenting with moving native applications and tools into Luau, then became increasingly interested in what could be accomplished with a relatively small native runtime and a much larger programmable environment.

That eventually produced L3i, JSL, and Jess.

Jess itself has grown into something much broader: applications, packages, workspaces, capability-controlled execution, and infrastructure for tools and games.

But the underlying motivation remains the same.

How much work can we move into Lua without giving up the performance and control that traditionally push developers toward native languages?

I don't think the answer is necessarily to turn Lua into Python or Rust. I like Lua precisely because it isn't those languages.

I do, however, think there are useful ideas worth borrowing.

Some come from Python. Some come from Rust. Some come from staring at a perfectly reasonable syntax decision and deciding that it simply isn't offensive enough.

And I'm perfectly willing to throw an idea away if the measurements don't justify keeping it.

For anyone interested in the implementation, the L3i dialect documentation covers the lowering model, semantics, source mappings, and performance measurements in detail.

Jess documentation: https://dreamweave-mp.github.io/jess/docs/

Both projects are open source under MIT/Apache-2.0. They're still evolving, and I'd welcome technically grounded criticism.

So here's a question.

What's one feature from another programming language that you desperately wish Lua or Luau had?

And, more importantly, what would it actually buy us?

I'm especially interested in features that improve expressiveness without imposing significant runtime costs, or that let us express operations in ways a compiler can optimize more effectively than conventional function-based APIs.

Tell me what you'd add. Tell me what you'd absolutely refuse to add.

Bring your worst ideas. I have a compiler and questionable impulse control.


r/lua • • 1d ago

LuaJIT Windows modules: UTF-8 file I/O, processes, registry, clipboard and more

1 Upvotes

I've published a collection of Windows API modules for LuaJIT:

https://github.com/win-kot/luajit-windows-modules

I use LuaJIT on Windows and put these modules together for common scripting

and desktop utility tasks:

- UTF-8 strings, Unicode file paths and encoding conversion

- Process launching and output capture

- Finding and controlling existing windows

- Registry and clipboard access

- Keyboard and mouse input

- Native file dialogs and system information

The modules call Windows APIs through LuaJIT FFI. No luv dependency is

required, and unicode_io provides an explicit API without replacing

standard io or os functions.

The repository includes English documentation and 12 runnable examples.

The primary target is Windows 10/11 x64. Everything is MIT licensed.

This is an initial public release. Basic checks and nine examples have

been run, but interactive features still need broader testing.

I'd welcome feedback from other LuaJIT users, especially on API usability

and compatibility with different Windows setups.


r/lua • • 3d ago

News I wrote a Scheme interpreter using Lua's approach combined with SICP

Thumbnail github.com
17 Upvotes

r/lua • • 4d ago

Limer 2.0: Build cross-platform desktop apps in Lua — write once, run anywhere

22 Upvotes

Hi r/lua!

I've been building Limer, a desktop development environment for creating GUI applications in Lua, and version 2.0 is out! It's available for Windows, macOS, and Linux.

The idea is simple: write your application once and use the same codebase across all three operating systems. No separate implementations for each platform.

What makes Limer interesting?

  • Visual designer: Drag real widgets onto a canvas, configure properties, arrange layouts, and generate readable Lua code that you can own and modify.
  • Live inspector: Inspect running applications, change widget properties, and execute Lua code.
  • 60+ widgets and components: Including layouts, charts, and SQLite support.
  • Standalone distribution: Limer comes with its required dependencies, so you don't need to install Lua separately or manually configure its runtime.
  • Application building: Package your projects for distribution across supported desktop platforms.
  • API search and error reporting: Find API functionality quickly and track down errors in your code.

Limer is built on Limekit, my GUI framework for Lua. Interestingly, Limer's development tools—including its project manager, code runner, visual designer, and live inspector—are themselves built in Lua using Limekit.

It's a Lua desktop app for building Lua desktop apps.

Prefer VS Code?

There's also a Limekit VS Code extension for developers who prefer their existing editor.

It includes code completion, API documentation, diagnostics, Lua error reporting, code snippets, and a Run button.

Download Limer 2.0

GitHub repository and downloads:
https://github.com/mitosisX/Limer-Limekit

The engine running all of the magic behind the scenes
https://github.com/mitosisX/Limekit

Limer and Limekit are free and open source under GPL-3.0.

If you find the project interesting, please consider giving the repository a ⭐ on GitHub! It helps more developers discover the project and motivates me to keep improving it.

A quick note: the macOS builds still need more testing on real Macs, and the applications aren't code-signed yet. Feedback and bug reports are very welcome.

I'd love to hear what you think. What would you build with Lua on the desktop?

Thanks for checking it out!


r/lua • • 7d ago

Library Should I add LuaRocks to my library?

Post image
28 Upvotes

I recently created my own framework named "Dua". Honestly, I'm too lazy to add LuaRocks, but only if I don't get feedback. You can learn more either in the repository or in my previous post. If I get feedback, I'll try to integrate LuaRocks.

Repo: Dua


r/lua • • 7d ago

Wanting to learn LUA Script

Thumbnail
0 Upvotes

r/lua • • 7d ago

DatumHue now free to use

4 Upvotes

DatumHue is now free to use and comes with a playground app

https://datumhue.app/?arg=playground&arg=pixels


r/lua • • 8d ago

Trials and Tribulation of Native Lua Compilation

Thumbnail samyeyo.github.io
9 Upvotes

r/lua • • 7d ago

Can somebody know an good web site for programing in block (i am an noob in lua)

Thumbnail
2 Upvotes

r/lua • • 7d ago

I'm building a ML framework that runs in Lua — would Roblox devs actually use this?

Thumbnail gallery
1 Upvotes

r/lua • • 9d ago

Library Built a pure Lua engine for creating custom DSLs with typed schemas and sandboxing (Dua).

Post image
9 Upvotes

Hey everyone,

I recently released Dua, a lightweight engine for building typed DSLs and sandboxed execution environments in Lua.

The goal was to create a zero-dependency library that runs anywhere Lua 5.1+, LuaJIT.

What it offers

Pure Lua implementation (no C modules or external dependencies)

Built-in sandboxing with configurable allow/deny rules and limits

Flexible type system (primitives, shapes, enums, maps, oneof)

AST node handling and code serialization

Repo: Dua


r/lua • • 11d ago

I announced a coop moddable lua game with 10 mini games

Enable HLS to view with audio, or disable this notification

29 Upvotes

https://store.steampowered.com/app/4185770/cenkers_mod/

cenker's mod is a multiplayer physics sandbox with many mods. Every mod has a different experience. Play included, community-made, and your own mods together with friends.


r/lua • • 11d ago

Library Ito: A Declarative TUI library in Lua

Thumbnail uji.sh
38 Upvotes

I've always loved the idea of JIT-compiled UIs. TempleOS is a fascinating example, using JIT-compiled C to build its UI.

Recently, I've been working on a TUI project where almost everything is customizable at runtime, from the UI itself to the core functionality. I wanted a way to build terminal UIs declaratively, similar to SwiftUI, while keeping the flexibility of runtime customization.

So I built Ito a Lua library for writing JIT-compiled TUIs.

To make it easy to experiment with, we also built a fake TUI canvas in the browser where you can try out Ito live. Give it a try!


r/lua • • 11d ago

How to make a code delay in lua?

4 Upvotes

Hey im new to coding and wanted to learn lua ive got a few things down know and wanted to just write a little countdown nothing complicated just a first test but ran into the problem that i cant get a code delay to work


r/lua • • 11d ago

I cracked games via lua tools on steam but some games need to be louched on other loucher but i can't bypas that can anyone help me with that pls

Thumbnail
0 Upvotes

Help


r/lua • • 11d ago

Dealing with a... Ghost script?

1 Upvotes

This will probably sound like the dumbest thing ya'll ever heard altough im rather new to lua, altough not programming..

I've been using lua with the minecraft mod figura to add animations to things with a script and such. quite nice, Untill i tried using the "trailing tails lua library", when saving the script it would keep getting stuck at the same error. i wondered why and noticed that the game was loading a old version of my script the one from the first save after using Trailing tails? i backedup the original script and deleted the one in the Figura avatar folder, and the game was still loading it.

a few unfortunate things happened the backup got removed(0 clue how the folder is just... new folder now?) but here's the thing, whilst i did try to recover it through the hard drive with little to no success, The game is still producing the same error, And loading the ingame avatar. this means its getting the data from somewhere no?

The very error that caused it may save the project that i spend... 20 hours on at this point. Is there anyway to figure out where the game gets this data from? maybe i can actually save it?

the script, Car, main and etc are from the library i mentioned. but they aren't producing the error. let alone are being loaded.
What the script used to look like

r/lua • • 11d ago

DatumHue - A Picotron inspired workstation for Lua apps

1 Upvotes

DatumHue is a creative workstation where you build your own experience by combining Lua apps. It runs natively and in the browser.

You can try a live instance in your browser at https://datumhue.app

The live instance has a desktop-like shell and a Steam-like store where users can publish free or paid creations, so far it contains the horror game Vigil.

A while ago I came across Lexaloffle's Picotron fantasy workstation and loved the concept of a hackable workstation composed of small script apps.

I wanted the same for non-fantasy work, which for me meant:

- No artificial limitations

- The shell is an ordinary app you create

- Your own preferred editor

- Charts and SQL over data files

- The same apps run in the browser and on the desktop

It's built on Bevy (game engine), Piccolo (Lua VM), Apache DataFusion (queries) and Iroh (connectivity).

DatumHue is closed source, the browser version is free and the desktop version has a free trial at https://datumhue.com

The Lua API is documented at https://datumhue.dev

Feedback is appreciated and I'd especially like to know what you would build with it :-)


r/lua • • 12d ago

A Command-line Argument parsing library for Lua I wrote for fun

Thumbnail codeberg.org
9 Upvotes

r/lua • • 12d ago

Project Pico2GBA - proof-of-concept project for adapting PICO-8 carts to Game Boy Advance hardware

Thumbnail github.com
8 Upvotes

r/lua • • 15d ago

LuaCAD 1.2 - Parametric 3D CAD in Lua, now with materials and path tracing

Post image
19 Upvotes

r/lua • • 16d ago

Hey! Can anybody help me learn Lua?

23 Upvotes

This is my first coding language I'm trying to learn, It's gonna be pretty difficult for me since I have amnesia and I know coding has a lot of things you need to remember. Currently I only know REALLY basic code like

"else, elseif, if, while, for.. e.g" I wanna learn Lua for game development, I don't really have any ideas for a game as of now but I do wanna learn Lua since I've heard it's one of the easiest coding languages, any help is greatly appreciated!


r/lua • • 16d ago

Project Hello, developers!

5 Upvotes

I recently started a project to meet a need at my church—software for projecting lyrics and Bible verses using 100% Lua—and I wanted to get your opinion on whether Lua is a good language for this type of project.

repo: https://codeberg.org/GSCF/gloria_projecao.git


r/lua • • 17d ago

Lua 5.5.1 working on W98

Thumbnail gallery
112 Upvotes

Hey, so, while I was learning Lua, I knew already that theoretically at least, Lua was written to be compilable in pure C, and specifically C89/C90 , supposedly any system that has an ANSI C compiler can compile and install Lua...

So I decided to actually test out just how true that is, when I remembered that I have an ancient laptop from 1999, running Windows 98SE, which has Borland 5.02 installed... [Just to understand how ancient it is, it only has 32 mb of RAM and it's hard drive is 5gb... that is literally smaller than the usb stick that i used to transfer the Lua source files from my modern PC into that ancient laptop (yes, that ancient laptop has a working USB 1.0 port and it is somehow able to read my 8gb USB 2.0 usb stick, which I did not expect to work, but it did !!!)

And to my surprise... it actually worked !

Here I am inside a full-screen MS-DOS prompt of W98 (In W32 mode, it is not booted into MS-DOS mode / real mode) Alongside the project of compiling the most recent version of Lua and getting it to work, I also installed an actual working version of vim and after tinkering with the vimrc file, I even managed to get full syntax highlighting working , and it actually works for Lua !!!

Anyhow, I just wanted to share this because I thought it was really cool and fun!