Live data from Hacker News

Lua 5.4.0 beta

lua-users.org

11–20 of 103 posts

Re: Lua 5.4.0 beta

#11
post #9
post #3

It's nice and all, but I'll be over here using LuaJIT.

Why wouldn't you be able to use this with LuaJIT? I thought LuaJIT was just a compiler for the Lua language.

LuaJIT is an entirely different VM. It is binary compatible with Lua 5.1.x modules (shared libraries) and can run most Lua 5.1 and 5.2 code. A good amount of the 5.2 changes, specifically those which do not break 5.1 code, have been added to the VM.

Re: Lua 5.4.0 beta

#12
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?

Re: Lua 5.4.0 beta

#13
post #9
post #3

It's nice and all, but I'll be over here using LuaJIT.

Why wouldn't you be able to use this with LuaJIT? I thought LuaJIT was just a compiler for the Lua language.

LuaJIT officially supports up to Lua 5.1.x, mainly due to Mike Pall not liking all changes to the language that followed

https://www.freelists.org/post/luajit/Port-bitop-to-53,1

Re: Lua 5.4.0 beta

#16
Just recall that Lua versioning schema allows for breaking changes to point releases.

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.

https://www.lua.org/versions.html

Re: Lua 5.4.0 beta

#18

People that use lua, what do you use it for and why did you pick lua?

I use it as a configuration and data language, mostly for building APIs for other libraries (like SDL2).

The syntax is simple and clean, like JSON but without the most commonly cited warts (no requirement to quote keys, and comments are allowed.) The VM is lightweight enough that including it in an application is practically inconsequential. I like its modular syntax as well. There are also bindings for just about every language out there, making Lua code more easily portable and embeddable.

It's not without its flaws as a language but to me, it's better suited as a config language than TOML, YAML or XML for most use cases where you don't actually need their complexity, or JSON if you're not on the web.

Re: Lua 5.4.0 beta

#19
post #2

Main changes - new generational mode for garbage collection - to-be-closed variables - const variables - userdata can have multiple user values - new implementation for math.random - warning system - debug information about function arguments and returns - new semantics for the integer 'for' loop - optional 'init' argument to 'string.gmatch' - new functions 'lua_resetthread' and 'coroutine.close' - coersions string-t…

What would you use coroutine.close () for?

Re: Lua 5.4.0 beta

#20

People that use lua, what do you use it for and why did you pick lua?

For KVdb [1], my managed key-value store database, I opted to integrate Lua as a scripting language instead of JavaScript because it felt super lightweight and the syntax is easy to learn in a few hours for even newbies. I'll probably end up adding JavaScript, too, since most developers know it, but there is a simplicity about Lua that I haven't seen in many other somewhat popular languages.

[1] https://kvdb.io/docs/scripting

Post reply on HN