making lua do what it shouldn't: typesafe structs
https://if-not-nil.github.io/lua-structs/
https://redd.it/1plw6o7
@r_lua
https://if-not-nil.github.io/lua-structs/
https://redd.it/1plw6o7
@r_lua
if-not-nil.github.io
making lua do what it shouldn't: typesafe structs
it shouldn't, but it should should, if that makes sense
LuaJIT Compiler
Successfully managed to make a compiler for luaJIT (a lua 5.1 fork/thing optimized for performance) in python
Works by getting the source code of luajit, rewriting the main .c file to execute a specific noscript instead of whatever you have as the first argument, and using a portable minGW thingy to compile it to EXE. (Dosent actually turn it into assembly, im not that good)
This is compatible with most lua noscripts that work for lua 5.1 or less, and luajit noscripts
Should i make it open source?
(I know luastatic exists, but this is way damn simpler)
https://preview.redd.it/aomysk89817g1.png?width=747&format=png&auto=webp&s=0251c0ce550bcdd15e83b3779bc027b9a6d57b65
https://redd.it/1plvch2
@r_lua
Successfully managed to make a compiler for luaJIT (a lua 5.1 fork/thing optimized for performance) in python
Works by getting the source code of luajit, rewriting the main .c file to execute a specific noscript instead of whatever you have as the first argument, and using a portable minGW thingy to compile it to EXE. (Dosent actually turn it into assembly, im not that good)
This is compatible with most lua noscripts that work for lua 5.1 or less, and luajit noscripts
Should i make it open source?
(I know luastatic exists, but this is way damn simpler)
https://preview.redd.it/aomysk89817g1.png?width=747&format=png&auto=webp&s=0251c0ce550bcdd15e83b3779bc027b9a6d57b65
https://redd.it/1plvch2
@r_lua
Roblox coding for everyone !
Hi there ! If you see this you may be a person that need a code for his Roblox game!
I'm here to help!
I was a rookie noscripter back then and I know how hard it is to code and make a game so everyone who will send me a message or a comment and I will get you the code (noscript) for acctualy free
If it has the limit of 200 words if not you will need to pay 400 Robux for extra 1000
Good luck!
https://redd.it/1plu6vo
@r_lua
Hi there ! If you see this you may be a person that need a code for his Roblox game!
I'm here to help!
I was a rookie noscripter back then and I know how hard it is to code and make a game so everyone who will send me a message or a comment and I will get you the code (noscript) for acctualy free
If it has the limit of 200 words if not you will need to pay 400 Robux for extra 1000
Good luck!
https://redd.it/1plu6vo
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I need some help with lua-periphery
Okay, so I'm making a silly little desktop toy for myself, as a way to learn some more advanced Lua and Love2d, running on a Raspi 4.
Here's the code so far: https://hastebin.cc/decutuhomu.lua
So here's what happens - it launches a window (because Love2D), and in the terminal it just waits. I have a little 4x3 matrix keypad wired up to the GPIO pins, and I can correctly get the button pressed. That part's all sorted. What's currently happening is it lets me press any button, but only registers a different button from the last pressed. ie, I can press 1 2 3, no problem. If I press the same button twice, it doesn't register. (I know why). How can I set this up to 'release' the button pressed?
The library I'm using is lua-periphery, (https://github.com/vsergeev/lua-periphery) which seems to be well documented, but as I'm a relative noob to Lua, the lack of examples isn't really helping.
Basically, I want to be able to press a button repeatedly, with each separate press counting.
https://redd.it/1pmzo5u
@r_lua
Okay, so I'm making a silly little desktop toy for myself, as a way to learn some more advanced Lua and Love2d, running on a Raspi 4.
Here's the code so far: https://hastebin.cc/decutuhomu.lua
So here's what happens - it launches a window (because Love2D), and in the terminal it just waits. I have a little 4x3 matrix keypad wired up to the GPIO pins, and I can correctly get the button pressed. That part's all sorted. What's currently happening is it lets me press any button, but only registers a different button from the last pressed. ie, I can press 1 2 3, no problem. If I press the same button twice, it doesn't register. (I know why). How can I set this up to 'release' the button pressed?
The library I'm using is lua-periphery, (https://github.com/vsergeev/lua-periphery) which seems to be well documented, but as I'm a relative noob to Lua, the lack of examples isn't really helping.
Basically, I want to be able to press a button repeatedly, with each separate press counting.
https://redd.it/1pmzo5u
@r_lua
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 noscripts 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:
https://youtu.be/QYODYqnkzvQ
How to try it:
If you have Node installed, it's just a one-line install:
```bash
npm install -g u/tenumdev
tlua your\noscript.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:
1. Install
2. Throw your weirdest, most complex noscripts at it.
3. Report what breaks.
If you find an assertion failure or a noscript 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!
https://redd.it/1pn5pha
@r_lua
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 noscripts 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:
https://youtu.be/QYODYqnkzvQ
How to try it:
If you have Node installed, it's just a one-line install:
```bash
npm install -g u/tenumdev
tlua your\noscript.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:
1. Install
tlua.2. Throw your weirdest, most complex noscripts at it.
3. Report what breaks.
If you find an assertion failure or a noscript 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!
https://redd.it/1pn5pha
@r_lua
YouTube
Run Lua Scripts Instantly with NPM (No Build Chain Required) | TENUM Demo
We have made major updates to our `tlua` implementation! In this video, we demonstrate how easily you can run foreign Lua noscripts locally using TENUM without setting up a complex build chain.
We successfully ran `u-test` (a unit testing framework) on our…
We successfully ran `u-test` (a unit testing framework) on our…
Ai with Lua?
Is there any ai that can write Lua coding for me that is free (not just free tier like fully free no limits) if your just gonna say something about ai slop or trash just skip this post
https://redd.it/1po4123
@r_lua
Is there any ai that can write Lua coding for me that is free (not just free tier like fully free no limits) if your just gonna say something about ai slop or trash just skip this post
https://redd.it/1po4123
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I need help executing lua files on VScode
(Sorry for bad english)
I'm using PopOS
Already installed lua with "sudo apt install 5.4" and everything is fine.
When I try to execute a file in VScode terminal with "lua5.4 filename.lua " or "lua filename.lua"
It appears "lua5.4: command not found"
Can someone help me please? Im new on Linux and dont know if I need to do another command on terminal.
https://redd.it/1pp8se1
@r_lua
(Sorry for bad english)
I'm using PopOS
Already installed lua with "sudo apt install 5.4" and everything is fine.
When I try to execute a file in VScode terminal with "lua5.4 filename.lua " or "lua filename.lua"
It appears "lua5.4: command not found"
Can someone help me please? Im new on Linux and dont know if I need to do another command on terminal.
https://redd.it/1pp8se1
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How to prevent Lua from aborting the entire program
im trying to embed Lua 5.3.6 into a game, but i dont want lua to abort my program when it encouters an error, and i cant find a way to make sure these two functions are called in protected mode, the first function is called from a lua_CFunction, second is a lua_CFunction, i dont want to have to call all my c functions using pcall in lua, but im fine with pcall in cpp
GameObjectType get_GameObjectType(lua_State L, const int idx) {
void ud = luaL_checkudata(L, idx, "core.GameObjectType");
luaL_argcheck(L, ud != nullptr, idx, "GameObject expected");
return static_cast<GameObjectType >(ud);
}
static int coregetroot (luaState *L) {
auto *gameobjecttype = createGameObjectType(L);
try {
gameobjecttype->object = core::getroot();
} catch (const std::exception& e) {
luaLerror(L,e.what());
}
return 1;
};
https://redd.it/1pql0w6
@r_lua
im trying to embed Lua 5.3.6 into a game, but i dont want lua to abort my program when it encouters an error, and i cant find a way to make sure these two functions are called in protected mode, the first function is called from a lua_CFunction, second is a lua_CFunction, i dont want to have to call all my c functions using pcall in lua, but im fine with pcall in cpp
GameObjectType get_GameObjectType(lua_State L, const int idx) {
void ud = luaL_checkudata(L, idx, "core.GameObjectType");
luaL_argcheck(L, ud != nullptr, idx, "GameObject expected");
return static_cast<GameObjectType >(ud);
}
static int coregetroot (luaState *L) {
auto *gameobjecttype = createGameObjectType(L);
try {
gameobjecttype->object = core::getroot();
} catch (const std::exception& e) {
luaLerror(L,e.what());
}
return 1;
};
https://redd.it/1pql0w6
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
is luadist safe to install lua?
if not,how can i install it for windows 10
thanks:)
https://redd.it/1pt7x7o
@r_lua
if not,how can i install it for windows 10
thanks:)
https://redd.it/1pt7x7o
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Vectarine: A game framework for ultra fast prototyping
I really like Love2D for making games, but it is annoying to export on the web. I like participating in game jams on itch.io and having a web version for people to test is a must. Moreover, I need to restart my game when I make a change to see it which slows me down where coding. That's why I made https://github.com/vanyle/vectarine/ It is a hybrid between a framework and a game engine.
You write your game in Lua (or Luau) and as you save, you see changes instantly. Also, I've automated the export process to make is super simple + added a bunch of other helpful tools to simplify debugging
The engine's interface looks like this:
https://preview.redd.it/tbochxvdcf9g1.png?width=1824&format=png&auto=webp&s=8f3178b29eadae72982997de4ef4a8d3ed4111e5
I'm open to feedback! There is a lot missing right now like Joystick support but I want to improve it over time.
https://redd.it/1pvo97d
@r_lua
I really like Love2D for making games, but it is annoying to export on the web. I like participating in game jams on itch.io and having a web version for people to test is a must. Moreover, I need to restart my game when I make a change to see it which slows me down where coding. That's why I made https://github.com/vanyle/vectarine/ It is a hybrid between a framework and a game engine.
You write your game in Lua (or Luau) and as you save, you see changes instantly. Also, I've automated the export process to make is super simple + added a bunch of other helpful tools to simplify debugging
The engine's interface looks like this:
https://preview.redd.it/tbochxvdcf9g1.png?width=1824&format=png&auto=webp&s=8f3178b29eadae72982997de4ef4a8d3ed4111e5
I'm open to feedback! There is a lot missing right now like Joystick support but I want to improve it over time.
https://redd.it/1pvo97d
@r_lua
itch.io
itch.io is a simple way to find, download and distribute indie games online. Whether you're a developer looking to upload your game or just someone looking for something new to play itch.io has you covered.
Can I learn lua with dyslexia
I seen bits of lua and it looks fun but I have dyslexia and have a hard time with long words so I was wondering if lua may not be the best thing for me to try to make a hobby and if so where is the best place to try to learn lua with like hand on. Because I dont want to watch a video that is just going to tell me how to do anything. I learn better well doing it myself as well. And one other thing how long does it take the average person to learn lua?
https://redd.it/1q02ksm
@r_lua
I seen bits of lua and it looks fun but I have dyslexia and have a hard time with long words so I was wondering if lua may not be the best thing for me to try to make a hobby and if so where is the best place to try to learn lua with like hand on. Because I dont want to watch a video that is just going to tell me how to do anything. I learn better well doing it myself as well. And one other thing how long does it take the average person to learn lua?
https://redd.it/1q02ksm
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Need help updating code (for gmod)
I found a gmod mod that allows you to get some cool camera shots but it doesn't work. From what I understand it is outdated and I need help updating it since I don't know basically any coding. Some of the commands work but the really important ones don't. I have fixed the "add" command by replacing
Basically all the command say something like this
\] smoothcam play
[ERROR\] lua/autorun/smoothcam.lua:147: attempt to index global 'gui' (a nil value)
1. Play - lua/autorun/smoothcam.lua:147
2. unknown - lua/autorun/smoothcam.lua:416
3. unknown - lua/includes/modules/concommand.lua:54
link to the original mod: https://github.com/WilliamVenner/gmod-smoothcam
https://redd.it/1q0btqp
@r_lua
I found a gmod mod that allows you to get some cool camera shots but it doesn't work. From what I understand it is outdated and I need help updating it since I don't know basically any coding. Some of the commands work but the really important ones don't. I have fixed the "add" command by replacing
GetViewEntity() with Entity( 1 ):GetViewEntity() but other than that it is difficult to know what to do.Basically all the command say something like this
\] smoothcam play
[ERROR\] lua/autorun/smoothcam.lua:147: attempt to index global 'gui' (a nil value)
1. Play - lua/autorun/smoothcam.lua:147
2. unknown - lua/autorun/smoothcam.lua:416
3. unknown - lua/includes/modules/concommand.lua:54
link to the original mod: https://github.com/WilliamVenner/gmod-smoothcam
https://redd.it/1q0btqp
@r_lua
GitHub
GitHub - WilliamVenner/gmod-smoothcam: Garry's Mod cinematic tool for smooth + precise camera interpolation along defined paths
Garry's Mod cinematic tool for smooth + precise camera interpolation along defined paths - WilliamVenner/gmod-smoothcam
I built a Lua/Luau obfuscator with control-flow flattening and anti-tamper - looking for feedback
I’ve been working on a Lua/Luau obfuscator as a side project.
It’s not just a renamer - it includes:
string encryption
control-flow flattening
integrity-bound API indirection
environment hardening (anti-hooking)
Here’s a small before/after example:
*https://pastebin.com/raw/GNFGha8e*
I’m mainly looking for feedback or ideas on what could be improved.
If anyone’s curious, I have a Discord where I post builds and updates.
https://redd.it/1q0gbj8
@r_lua
I’ve been working on a Lua/Luau obfuscator as a side project.
It’s not just a renamer - it includes:
string encryption
control-flow flattening
integrity-bound API indirection
environment hardening (anti-hooking)
Here’s a small before/after example:
*https://pastebin.com/raw/GNFGha8e*
I’m mainly looking for feedback or ideas on what could be improved.
If anyone’s curious, I have a Discord where I post builds and updates.
https://redd.it/1q0gbj8
@r_lua
Is Lua the right step to learn how to code a roblox game?
So, I want to learn how to code so I can make my own story game on roblox. Yet, I am not sure if I am going in the right step or not. Since I heard that Roblox game used Lua or a variation of it.
If it is, what resources should I use to learn lua more, since I am finding coddy tech frustating to use and learn from. Since I would type it thinking I got it correct but then I am stuck and the ai help doesn't work for me. (A human imput would be better since I normally find when a human who has experince can normally find out what I did wrong)
If this isn't the correct step then what should I do instead?
https://redd.it/1q15r42
@r_lua
So, I want to learn how to code so I can make my own story game on roblox. Yet, I am not sure if I am going in the right step or not. Since I heard that Roblox game used Lua or a variation of it.
If it is, what resources should I use to learn lua more, since I am finding coddy tech frustating to use and learn from. Since I would type it thinking I got it correct but then I am stuck and the ai help doesn't work for me. (A human imput would be better since I normally find when a human who has experince can normally find out what I did wrong)
If this isn't the correct step then what should I do instead?
https://redd.it/1q15r42
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
What are some of your problems with lua?
Love2d and other libraries are welcome but just say what library your talking about
https://redd.it/1q1euey
@r_lua
Love2d and other libraries are welcome but just say what library your talking about
https://redd.it/1q1euey
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Not sure if this is allowed but I'm looking for people to help with my project
https://redd.it/1q27234
@r_lua
https://redd.it/1q27234
@r_lua