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.

Lualogo

The language supports functions as first class objects, closure and extensible semantics. It also isn't a class-based language. Overall it most resembles JavaScript of all the currently popular languages.

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.  

 

Lualogo

More Information

Lua Website

Related Articles

Lua 5.3 Released  

Lua 5.2.0 Released

Standalone Lua Development Tools 

Terra - A Language For Lua

Seven More Languages in Seven Weeks (book review)

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Microsoft Introduces .NET Smart Components
01/04/2024

Microsoft has provided a set of .NET Smart Components, described as a set of genuinely useful AI-powered UI components that you can quickly and easily add to .NET apps. The components are prebuilt end [ ... ]



Spider Courtship Decoded by Machine Learning
07/04/2024

Using machine learning to filter out unwanted sounds and to isolate the signals made by three species of wolf spider has not only contributed to an understanding of arachnid courtship behavior, b [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:1789343224>

<ASIN:1941222153>

<ASIN:8590379868>

<ASIN:1118918215>

Last Updated ( Friday, 03 July 2020 )