lua-users home
lua-l archive


2011/11/18 Dirk Laurie <>:
> Just as Lua is written in "clean C, the common subset of Standard C
> and C++", one can write one's new programs in "clean Lua, the common
> subset of Lua 5.1 and 5.2".  Here is a partial list.
> 1. unpack = unpack or table.unpack
> 2. Don't use # or the table library on non-sequences.
> 3. Don't use goto.
> 4. Write modules to return a table containing everything and load them by
>    mymod = require "mymod"
> 5. Load bit32 explicitly if you need it.

Hi Dirk,

I understand you point but in this does not invalidate my remarks, you
are just saying the you can cope with Lua 5.2. Of course you can, Lua
5.2 is still a very neat programming language but my point was that
you break compatibility the hard way for little or no gain at all.

Many people was using getfenv/setfenv regularly and this will not work
anymore. Also on the C side this will heavily affect programmers since
that feature was routinely used and isn't anymore available.

You should also think about LuaJIT2 since now many Lua users use
LuaJIT now and it seems that switch to 5.2 will be a good amount of
work for a lot of people without any clear gain.

Your argument about "the clean subset" is especially true for
languages like Javascript and for C++. The fact that a clean subset
exists it doesn't mean that you can change the language without any
concern about compatibility.

My point is that in some case you can break compatibility but it is
reasonable to do so only when you have important advantages by making
the changes.