Live data from Hacker News

Lua 5.4.0 beta

lua-users.org

61–70 of 103 posts

Re: Lua 5.4.0 beta

#62

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

I used it because that's what I needed for configuring Hammerspoon. Been rather pleased with the language overall, but don't have any other uses for it. Hammerspoon has been killer, especially once I figured out some simple metaprogramming.

Re: Lua 5.4.0 beta

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

Re: Lua 5.4.0 beta

#64

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

I don't think there's any reason to upgrade unless some of your dependencies require a higher version and backporting is more expensive that porting over all your existing code. Since it sounds like you expose libraries with your own code and you have full control over your ecosystem, I don't think it makes sense to upgrade. At least in my project I see no reason to switch away from LuaJIT (so ~5.1/5.2). It works perfectly well and I don't see why that would change.

Re: Lua 5.4.0 beta

#65

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

In an embedded system sometimes the "leave it alone" factor outweighs the new features.

Anyway, you can find a summary of changes since 5.1 here: https://www.lua.org/versions.html

One of the biggest changes was the introduction of 64 bit integers in Lua 5.3

Perhaps my favorite little change is that you don't need to type = in the repl to print an expression anymore.

Re: Lua 5.4.0 beta

#66
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.

Re: Lua 5.4.0 beta

#67

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 documentation lacks for some topics of you use the c api. I'm surprised to hear this. I'm doing a lot of Lua and I always thought the documentation is very succinct and complete. I really curious when issues you ran into. > The thing is lua on embedded has no rival. but god did it cost me some nerves. You might take a look at https://bellard.org/quickjs/ and https://duktape.org/ . The latter seems oddly familia…

I worked on a product that used Lua and didn’t particularly like it. I’ve never used it, but I do like the syntax and style of Wren (http://wren.io/)

Re: Lua 5.4.0 beta

#68

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.

You can choose what parts of the standard library scripts allowed to use. Just exclude os/debug libraries, and that's it. Newer versions of the Programming in Lua book contain detailed instructions.

Re: Lua 5.4.0 beta

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

Re: Lua 5.4.0 beta

#70

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 supports sandboxing via its _G variable, i.e., implicit global scope. When you call a script, you can pass it a custom _G.
Post reply on HN