|Lua 5.4 Released|
|Written by Kay Ewbank|
|Friday, 03 July 2020|
There's a new release of the scripting language Lua, five years after the previous update. Version 5.4 brings improved garbage collection, support for to-be-closed variables and a new implementation of math.random.
Lua is a scripting language popular for embedding in games and in industrial applications such as robotics, image processing, text editors and web development. It was created in Brazil and was designed to be simple, small, portable, fast, and easily embedded into applications.
The first improvement to the new release is a new generational mode for garbage collection. This means the collector does frequent minor collections where the collector traverses only those objects that have been recently created. If after a minor collection the use of memory is still above a limit, the collector does a stop-the-world major collection, which traverses all objects.
Another improvement is support for to-be-closed variables. These behave like constant local variables, but their value is closed whenever the variable goes out of scope, including when this is by normal block termination, exiting its block by break/goto/return, or exiting by an error.
There's also a new implementation for math.random. In the previous version, math.random was based on the standard C rand function, which has the disadvantage that it gives different results on Windows and Linux. The new release bases the math.random function on xoshiro256** algorithm which produces pseudo-random 64-bit integers.
Other improvements include support for const variables, and the ability for userdata to have multiple user values. There's a new warning system, and you can get debug information about function arguments and returns. A number of other minor improvements can be found in the readme documentation.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Friday, 03 July 2020 )|