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


GitHub Universe AI Announcements - Copilot And Spark
30/10/2024

GitHub has announced several improvements for developers at Universe, its annual conference. Developers will get multi-model Copilot and GitHub Spark, an AI-native tool for building applications in na [ ... ]



Zitadel Announces Funding And Future Plans
21/11/2024

Zitadel has announced a major funding round that will be used to expand technical teams and fund further product development. The company is the creator of an open source project for cloud-native iden [ ... ]


More News

espbook

 

Comments




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

<ASIN:1789343224>

<ASIN:1941222153>

<ASIN:8590379868>

<ASIN:1118918215>

Last Updated ( Friday, 03 July 2020 )