We use lua 5.3 on an embedded Platform for scripting and it has been a roller coaster ride. Not a fun one, unfortunately.
You want luasocket? The stable one is not compatible with 5.3.
Packages are sometimes outdated (for years no updates) and there is no replacement.
The lua point releases have breaking changes.
The source code itself is a macro hell which is hard to debug. And the code is not very readable. The documentation lacks for some topics of you use the c api. I tried to implement some scheduling for c and lua threads.<p>Oh and one thing if you must use Windows... you better quit right away. I had to help my co worker Installing it with luarocks and it is a mess. to be fair it was easy on my Ubuntu machine.<p>The thing is lua on embedded has no rival. but god did it cost me some nerves.
Main changes<p>- new generational mode for garbage collection<p>- to-be-closed variables<p>- const variables<p>- userdata can have multiple user values<p>- new implementation for math.random<p>- warning system<p>- debug information about function arguments and returns<p>- new semantics for the integer 'for' loop<p>- optional 'init' argument to 'string.gmatch'<p>- new functions 'lua_resetthread' and 'coroutine.close'<p>- coersions string-to-number moved to the string library<p>- allocation function allowed to fail when shrinking a memory block<p>- new format '%p' in 'string.format'<p>- utf8 library accepts codepoints up to 2^31
Just recall that Lua versioning schema allows for breaking changes to point releases.<p>This has been both great for Lua as a Lua and one of its biggest challenges. It's allowed the language be constantly refined and tweaked; however, at the expense that it's super common for applications to complete break when upgraded to a point release.<p><a href="https://www.lua.org/versions.html" rel="nofollow">https://www.lua.org/versions.html</a>
I use Lua via OpenResty / lua-nginx-module and in personal C projects for plugins and scripting. Some of these seem useful, like utf8 support and const variables.<p>For the multiple user data values feature, I've always found lightuserdata more useful than userdata, because it's not often that you need just one bunch of simple memory that can be freed without any other work. Rather, I almost always have more complex data, such as things that need manual cleanup like sockets, handles, etc. Or, the structure has pointers to other things that must also be cleaned up. What I'd like instead is the ability to pass a destructor callback to `lua_pushlightuserdata` so that it get's called when the pointer falls off the stack.<p>I don't use Lua threads or coroutines currently, so I don't have much to add there. What I do wish is that there were a way to clone or pass objects from one lua state to another to support parallelism. Basically, I'm thinking of it like the work Eric Snow is doing on subinterpreters in Python. Passing values (by copying, no shared memory) between lua instances.<p>One use case I had is loading a plugin that you then want to run multiple instances of in parallel with different arguments. Ideally, you wouldn't have to load the plugin multiple times (therefore calling the module level code multiple times). So I'd like to copy the entire lua state and then run each one with different arguments. There's no userdata, coroutines, or lua threads, so I don't have to worry about things that aren't possible to copy.<p>I got as far as looking into how to copy functions and then got busy with other things and stopped. Is there anyone else out there trying to introspect Lua function structures and copy all the opcodes, upvalues, etc?
It seems that quite a lot of people use Lua.
I liked the language, it's tiny and well-made. However, I wasn't happy about the tooling support. IDE plugins, documentation generators, lint checkers – all of this seem abandoned.
Is there any similar language (embeddable, good C interoperability) with better tooling besides JavaScript?
This is probably not the right place to ask but ..., given that Lua is commently embedded in games, anyone know of a sandboxed version? I'd love to provide a scripting language for user mods to a game but I'd like as much as possible to not have to trust the mods.
I'm looking through the new reference manual and there doesn't seem to be any mention of const variables, or any mention of how the new to-be-closed variables work. Do you just define the __close metamethod and lua takes care of the rest?
We use Lua 5.1 in an embedded system and it works great. We use only a few standard libraries and have several dozen of our custom libraries exposed as Lua APIs. Predictable memory usage is really good. It's several years since we picked the then current version of Lua and have had no reason to upgrade. What would be the motivations to upgrade to a new Lua version on an embedded system where there is a working version?
Does this release influence LuaTex? Or rather, maybe, how is it going with LuaTex?<p>I've previously opted for LuaTex rather than "base" Tex or XeLaTex and I'm at the point where I'd happily stick to LuaTex and also learn some of it's more technical aspects.