lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 26 March 2014 23:41, Coda Highland <chighland@gmail.com> wrote:
> On Wed, Mar 26, 2014 at 3:20 PM, Hisham <h@hisham.hm> wrote:
>> On 26 March 2014 18:59, Coda Highland <chighland@gmail.com> wrote:
>>> On Wed, Mar 26, 2014 at 2:45 PM, Tim Hill <drtimhill@gmail.com> wrote:
>>>> The code generated has only one conditional branch … significant on a non super-scalar CPU.
>>>>
>>>> Mostly of course these are techniques used in assembly language “poking through” into C.
>>>
>>> If we broaden the discussion to the greater Lua ecosystem as opposed
>>> to limiting our scope to PUC-Rio, this can be relevant even in a
>>> scripting language. An implementation such as LuaJIT (which I wouldn't
>>> be surprised to see pick up the new bitops even though it hasn't
>>> picked up many 5.2-isms)
>>
>> Which 5.2-isms it did not pick up, apart from _ENV? (I mean of course
>> in the language itself; I understand the 5.2 C API was not picked up
>> at all.) As far as I remember, LuaJIT supports practically all of 5.2.
>>
>> http://luajit.org/extensions.html#lua52
>
> "Apart from _ENV" isn't an insignificant divergence from the specification.

I didn't mean to imply it was, but there's a whole lot of programming
you can do without explicitly using _ENV. The LuaRocks source code,
for example, does not use it. In one of the few places where I have
5.1-only and 5.2-only branches, the 5.1 branch uses setfenv() and the
5.2 branch uses loadfile() with the env argument, which _is_ supported
by LuaJIT.

https://github.com/keplerproject/luarocks/blob/master/src/luarocks/persist.lua#L34-L45

So, for LuaRocks at least, LuaJIT with -DLUAJIT_ENABLE_LUA52COMPAT
could "pass" as Lua 5.2 well enough.

So, my question was not rhetorical; I'd really like to know if there's
anything else from Lua 5.2 that's not available in LuaJIT. At first
glance, the extensions list in the aforementioned link seems pretty
complete to me.

-- Hisham