Lua 5.2.0 released

Lua 5.2.0 released

Postby shirish » 19 Dec 2011, 21:02

Hi all,
Just wanted to share that Lua 5.2.0 got released. I dunno if the new release has things that many people had asking for or not. Here's the changelog :-

{l Code}: {l Select All Code}
Changes since Lua 5.1

Here are the main changes introduced in Lua 5.2. The reference manual lists the incompatibilities that had to be introduced.
Main changes

    yieldable pcall and metamethods
    new lexical scheme for globals
    ephemeron tables
    new library for bitwise operations
    light C functions
    emergency garbage collector
    goto statement
    finalizers for tables

Here are the other changes introduced in Lua 5.2:
Language

    no more fenv for threads or functions
    tables honor the __len metamethod
    hex and \z escapes in strings
    support for hexadecimal floats
    order metamethods work for different types
    no more verification of opcode consistency
    hook event "tail return" replaced by "tail call"
    empty statement
    break statement may appear in the middle of a block

Libraries

    arguments for function called through xpcall
    optional 'mode' argument to load and loadfile (to control binary x text)
    optional 'env' argument to load and loadfile (environment for loaded chunk)
    loadlib may load libraries with global names (RTLD_GLOBAL)
    new function package.searchpath
    modules receive their paths when loaded
    optional base in math.log
    optional separator in string.rep
    file:write returns file
    closing a pipe returns exit status
    os.exit may close state
    new metamethods __pairs and __ipairs
    new option 'isrunning' for collectgarbage and lua_gc
    frontier patterns
    \0 in patterns
    new option *L for io.read
    options for io.lines
    debug.getlocal can access function varargs

C API

    main thread predefined in the registry
    new functions lua_absindex, lua_arith, lua_compare, lua_copy, lua_len, lua_rawgetp, lua_rawsetp, lua_upvalueid, lua_upvaluejoin, lua_version.
    new functions luaL_checkversion, luaL_setmetatable, luaL_testudata, luaL_tolstring.
    lua_pushstring and pushlstring return string
    nparams and isvararg available in debug API
    new lua_Unsigned

Implementation

    max constants per function raised to 226
    generational mode for garbage collection (experimental)
    NaN trick (experimental)
    internal (immutable) version of ctypes
    simpler implementation for string buffers
    parser uses much less C-stack space (no more auto arrays)

Lua standalone interpreter

    new -E option to avoid environment variables
    handling of non-string error messages


Of course as it is a .0 release most of the devs. would probably wait it to mature a bit more but still there might be some feature that might make it enticing for game developers. I have no idea, I am just a gamer :P
shirish
 
Posts: 166
Joined: 17 Jan 2011, 15:06

Re: Lua 5.2.0 released

Postby andrewj » 20 Dec 2011, 04:21

Kudos to him for another major release.

From my point of view though, this 5.2.0 release has not added anything which I really wanted. My project uses about 55000 lines of Lua code, and I could see that 5.2.0 was not going to get those features, hence a while ago I forked the 5.1.4 codebase and added my own customisations to it.

The main things I wanted and implemented in my fork are:
(1) optional commas at end of lines in data tables
(2) cleaner syntax for traversing lists and tables (new 'each' keyword)
(3) conditional operator like ?: from C / C++
(4) a 'continue' statement

P.S. a link to the site would have been good in the original post : http://www.lua.org
User avatar
andrewj
 
Posts: 194
Joined: 15 Dec 2009, 16:32
Location: Tasmania

Who is online

Users browsing this forum: No registered users and 1 guest