Live data from Hacker News

Lua 5.4.0 beta

lua-users.org

71–80 of 103 posts

Re: Lua 5.4.0 beta

#71
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…

> coersions string-to-number moved to the string library

Does this mean + can finally be used for string concatenation and .. disabled as an opt-in C flag?

Re: Lua 5.4.0 beta

#72
post #69

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?

QuickJS is a Lua-like JS interpreter if you’re ok with JS.

Re: Lua 5.4.0 beta

#73

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

I embed it as a simple interactive query language for a time system at the local computer club. I wanted to use guile, but my fellow computer clubbers lose all their intelligence when they see parentheses.

Re: Lua 5.4.0 beta

#74

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.

Lua is extremely sandboxable from hosting C. Just only add modules, functions and features you want added. Makes good use of the C preprocessor flags too. But also check out QuickJS as a neat alternative. But it probably doesn’t compare in speed to LuaJIT which is mostly the flavor used I think.

Re: Lua 5.4.0 beta

#75
post #69

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?

QuickJS is a Lua-like JS interpreter if you’re ok with JS.

Well, I'm not a big fan of JavaScript :) I like the direction ECMAScript is going. However, the clumsy things are going to stay because of backward compatibility.

Also, QuickJS is a good initiative, but I afraid it's not production-ready yet. It doesn't even have versioning and/or changelog.

Re: Lua 5.4.0 beta

#76
post #69

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?

[Nim][1] seems to be a potential option.

[1]: https://nim-lang.org/

Re: Lua 5.4.0 beta

#78
post #69

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?

[Nim][1] seems to be a potential option. [1]: https://nim-lang.org/

The language looks really nice. I especially like its strong-typing nature. It seems, though, that it won't be easy to embed – Nim compiler requires either gcc or clang.

Re: Lua 5.4.0 beta

#79

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 doc…

I'm not sure which embedded platform you're using but give AngelScript [0] a look.

I've been using it to extend some C++ code (bsnes emulator) and it's been fantastic. It's so nice to have a C++-like scripting language with natural script-host bindings that I don't have to think hard about creating or spend a lot of time writing marshalling code or worrying about memory layouts. On top of that nice script-host interface you get an actual usable scripting language without silly things like 1-based array indices.

That said, it does not come with any sort of standard packages like luasocket but there is support for defining your own modules.

Depending on the embedded platform you're using, there may not be support for the native calling convention and you may have to fall back to the generic calling convention, or you could roll your own code to accommodate your platform's calling convention.

[0] https://www.angelcode.com/angelscript/

Re: Lua 5.4.0 beta

#80

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 doc…

> The thing is lua on embedded has no rival

What about something like Nim which compiles to C?

https://nim-lang.org/

Post reply on HN