Live data from Hacker News

Lua 5.4.0 beta

lua-users.org

21–30 of 103 posts

Re: Lua 5.4.0 beta

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

Closing a looping coroutine from outside the loop?

Re: Lua 5.4.0 beta

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

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.

The thing is lua on embedded has no rival. but god did it cost me some nerves.

Re: Lua 5.4.0 beta

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

I suppose, just to close to-be-closed variables declared inside a sleeping coroutine.

Re: Lua 5.4.0 beta

#25
Does this release influence LuaTex? Or rather, maybe, how is it going with LuaTex?

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.

Re: Lua 5.4.0 beta

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

The interpreter also got many performance improvements under the hood.

Re: Lua 5.4.0 beta

#28
post #8

Earlier quoted context omitted.

why?

I use FFI and LuaJIT is significantly faster on my embedded platform. Also, you can yield in coroutines in places where you can not with the standard Lua VM, such as across pcall, xpcall, iterators, and in metamethods. It is fantastic software.

I think Lua 5.3 can yield at those places as well now.

Re: Lua 5.4.0 beta

#29

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

I've built a collection of Android musical instruments [0] and Lua was big win for the project. I was previously familiar with Lua and Love2D framework and I wanted to see how far I can push it. The language is expressive and lightning fast. Very few building blocks that fit together nicely. I dig tables as first class objects, and meta-tables to turn them into complex objects or call delegation mechanism.

My favorite feature is that it's interpreted. The Android app is just a runtime. I can edit source files right on the phone and re-execute. It's awesome prototyping platform.

[0] https://github.com/jmiskovic/hexpress

Post reply on HN