TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Lua 5.4.0 beta

142 pointsby dottrapover 5 years ago

14 comments

unbendableover 5 years ago
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.
评论 #21146897 未加载
评论 #21149660 未加载
评论 #21147598 未加载
评论 #21153496 未加载
评论 #21149900 未加载
dottrapover 5 years ago
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 &#x27;for&#x27; loop<p>- optional &#x27;init&#x27; argument to &#x27;string.gmatch&#x27;<p>- new functions &#x27;lua_resetthread&#x27; and &#x27;coroutine.close&#x27;<p>- coersions string-to-number moved to the string library<p>- allocation function allowed to fail when shrinking a memory block<p>- new format &#x27;%p&#x27; in &#x27;string.format&#x27;<p>- utf8 library accepts codepoints up to 2^31
评论 #21146754 未加载
评论 #21147037 未加载
评论 #21149123 未加载
评论 #21146398 未加载
alberthover 5 years ago
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&#x27;s allowed the language be constantly refined and tweaked; however, at the expense that it&#x27;s super common for applications to complete break when upgraded to a point release.<p><a href="https:&#x2F;&#x2F;www.lua.org&#x2F;versions.html" rel="nofollow">https:&#x2F;&#x2F;www.lua.org&#x2F;versions.html</a>
fullstopover 5 years ago
It&#x27;s nice and all, but I&#x27;ll be over here using LuaJIT.
评论 #21146105 未加载
评论 #21146056 未加载
neulandover 5 years ago
I use Lua via OpenResty &#x2F; 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&#x27;ve always found lightuserdata more useful than userdata, because it&#x27;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&#x27;d like instead is the ability to pass a destructor callback to `lua_pushlightuserdata` so that it get&#x27;s called when the pointer falls off the stack.<p>I don&#x27;t use Lua threads or coroutines currently, so I don&#x27;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&#x27;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&#x27;t have to load the plugin multiple times (therefore calling the module level code multiple times). So I&#x27;d like to copy the entire lua state and then run each one with different arguments. There&#x27;s no userdata, coroutines, or lua threads, so I don&#x27;t have to worry about things that aren&#x27;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?
评论 #21147926 未加载
ecmascriptover 5 years ago
People that use lua, what do you use it for and why did you pick lua?
评论 #21147973 未加载
评论 #21146396 未加载
评论 #21147890 未加载
评论 #21146436 未加载
评论 #21146855 未加载
评论 #21146958 未加载
评论 #21147588 未加载
评论 #21146283 未加载
评论 #21147321 未加载
评论 #21147610 未加载
评论 #21148402 未加载
评论 #21147162 未加载
评论 #21146348 未加载
评论 #21147974 未加载
评论 #21148545 未加载
评论 #21149148 未加载
评论 #21147150 未加载
评论 #21148266 未加载
bbmarioover 5 years ago
Wish they could improve the language syntax. It&#x27;s so unnecessarily verbose. Moonscript did a good job improving Lua.
评论 #21148028 未加载
评论 #21151456 未加载
daurnimatorover 5 years ago
This is only a beta release; final could still be a year away.....
yanexover 5 years ago
It seems that quite a lot of people use Lua. I liked the language, it&#x27;s tiny and well-made. However, I wasn&#x27;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?
评论 #21154054 未加载
评论 #21149403 未加载
评论 #21155739 未加载
评论 #21149141 未加载
greggman2over 5 years ago
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&#x27;d love to provide a scripting language for user mods to a game but I&#x27;d like as much as possible to not have to trust the mods.
评论 #21148936 未加载
评论 #21149165 未加载
评论 #21149062 未加载
nomadluapover 5 years ago
I&#x27;m looking through the new reference manual and there doesn&#x27;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?
评论 #21152281 未加载
astatineover 5 years ago
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&#x27;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?
评论 #21148698 未加载
评论 #21148744 未加载
mikorymover 5 years ago
Does this release influence LuaTex? Or rather, maybe, how is it going with LuaTex?<p>I&#x27;ve previously opted for LuaTex rather than &quot;base&quot; Tex or XeLaTex and I&#x27;m at the point where I&#x27;d happily stick to LuaTex and also learn some of it&#x27;s more technical aspects.
nikolayover 5 years ago
Unfortunately, we only care about LuaJIT, which is lagging behind.