r/lua • u/peakygrinder089 • Dec 15 '25
[Showcase] We are building a Lua 5.4 implementation distributable via NPM. It runs standard test suites, but we need help breaking it!
Hi everyone,
We’ve been working hard on TENUM, specifically on our Lua implementation (`tlua`). Our goal is to make modern app development fast and accessible, and a huge part of that is a robust Lua implementation.
We recently reached a milestone where we can successfully run foreign scripts and testing frameworks (like `u-test`) without issues.
The Demo
I put together a quick video showing how to install the runtime and run a standard unit testing framework in under 2 minutes without any complex build chains:
How to try it:
If you have Node installed, it's just a one-line install:
```bash
npm install -g u/tenum_dev
tlua your_script.lua
Why we are posting here: While we are aiming for full Lua 5.4.8 compatibility, we know that the last 5% is the hardest. We are heavily hunting for edge cases right now.
We would love for the r/Lua community to:
- Install
tlua. - Throw your weirdest, most complex scripts at it.
- Report what breaks.
If you find an assertion failure or a script that behaves differently than the standard Lua interpreter, please provide an issue with a minimum test case on our GitHub. We are happy to introduce that test case to our suite and fix it immediately.
Repo: https://github.com/TENUM-Dev/tenum/tree/dev
Let us know what you think!
10
u/vitiral Dec 15 '25 edited Dec 15 '25
Good work, nice to see Lua in more places.
Just FYI for folks, this is not free software - the source is available but the license is not free (as in freedom) - you are not permitted to modify and redistribute it. I don't personally have anything against non-free software except that I require being paid when doing any kind of work to support such efforts. Others may feel the same.
Best of luck!
2
u/jotapapel Dec 15 '25
Will do!
2
u/appgurueu Dec 15 '25
Have you tested performance yet? From a quick glance at your VM implementation (https://github.com/TENUM-Dev/tenum/blob/a574438f4f327937557bff6bc815a64ed4695c50/lua/src/commonMain/kotlin/ai/tenum/lua/vm/LuaVmImpl.kt#L828), it looks like you are doing a lot of work for every instruction.
1
u/SkyyySi Dec 15 '25
What was your reason behind writing a new Lua interpreter in Kotlin instead of just using the existing one through the C-API (which no-doupt has Java bindings already anyway)?
1
u/Turbulent_File3904 Dec 17 '25
what is the advantage of your implementation vs c implementation on lua? by the nature of language choice your implementation support way fewer platform than base lua implementation
1
u/jotapapel Dec 20 '25
I'm having an issue with running tlua with arguments, they don't seem to be passed on to the interpreter.