Tagged: 5.5, lua, programming, update
- This topic has 0 replies, 1 voice, and was last updated 1 day, 1 hour ago by peq42.
-
AuthorPosts
-
December 23, 2025 at 00:48 #6085peq42Keymaster
Lua 5.5, the latest version of the popular lightweight scripting language, has been released today, five years after Lua 5.4. This update brings several improvements and refined features aimed at optimizing the language’s efficiency, especially in terms of memory usage and garbage collection (GC) enhancements. There were some pretty cool changes.
Highlights of Lua 5.5 include:
-
Global variable declarations: It is now possible to explicitly declare global variables, which helps prevent common bugs related to the accidental creation of global variables.
-
Read-only for-loop variables: Variables used in
forloops are now immutable, meaning they can only be read and not changed within the loop, increasing code safety and predictability. -
Floating-point number printing: Floating-point numbers are printed in decimal with enough digits to ensure they can be read back accurately, improving precision when dealing with these numbers.
-
More levels for constructors: An increase in the number of allowed levels for constructors, enabling more complex data structures.
-
table.createfunction: A new function that allows the creation of tables with pre-allocated size, optimizing memory usage. -
utf8.offsetreturns the final position of a character: Theutf8.offsetfunction has been improved to return the final position of a character, making UTF-8 string handling easier. -
External strings support: Support for strings that use memory not managed by Lua, which is useful for integrations with other languages or systems.
-
New
luaL_openselectedlibsandluaL_makeseedfunctions: Additional functions that provide more control over opening selected libraries and generating seeds for random numbers. -
Garbage collection improvements: Introduction of a generational mode for the GC and performing major garbage collections incrementally, which improves performance and reduces latency.
-
More compact arrays: Large arrays now use about 60% less memory, a significant optimization for applications handling large datasets.
-
Dynamically loaded
readlineinlua.c: The command-line interpreterlua.cnow dynamically loads thereadlinelibrary, allowing for better compatibility and resource usage. -
Static (fixed) binaries: When loading a binary chunk in memory, Lua can reuse its original memory in some internal structures, an optimization for embedded environments.
-
Dumpandundumpreuse all strings: The serialization and deserialization process now reuses strings, saving memory. -
Auxiliary buffer reuses the buffer: When creating the final string, the auxiliary buffer reuses the buffer, enhancing efficiency.
-
-
AuthorPosts
- You must be logged in to reply to this topic.