3 ms·
The reason is that the _ENV feature added in 5.2 would significantly slow down LuaJIT if it were supported. It's possible that Luac and LuaJIT will re-converge
by scythe 9y ago
The reason is that the _ENV feature added in 5.2 would significantly slow down LuaJIT if it were supported. It's possible that Luac and LuaJIT will re-converge when Lua 6.0 is released, but arguments about this between Mike Pall amd Roberto Ierusalimschy have been unproductive so far. Until then, LuaJIT compiles Lua 5.1 with support for a few 5.2 and 5.3 features, particularly goto.
- rweichler 9y agoYou have any references to these arguments between the two gods?
- akavel 9y agoTotally not a concrete link, sorry, but - in a video from one of Lua conferences, I've seen Roberto mention in some polite yet clear way that talks with Mike which they had had always come to a standstill on something - at least that's how I recall it. On the other hand, since 2015, Mike was looking to pass luajit development on to someone else - so with this, situation could possibly change in the end. But I'm not sure what's the current status of this search; I seem to recall CloudFlare was reported to be in talks, but I don't know how it all ended - or if it's still unresolved.
- rweichler 9y agodfsjifdadisjodjafiosjdafs009dfsja9sdjf09fdas09sdf09j90dfsjifdad isjodjafiosjdafs009dfsja9sdjf09fdas09sdf09j90dfsjifdadisjodjafi osjdafs009dfsja9sdjf09fdas09sdf09j90dfsjifdadisjodjafiosjdafs00 9dfsja9sdjf09fdas09sdf09j90dfsjifdadisjodjafiosjdafs009dfsja9sd jf09fdas09sdf09j90dfsjifdadisjodjafiosjdafs009dfsja9sdjf09fdas0 9sdf09j90dfsjifdadisjodjafiosjdafs009dfsja9sdjf09fdas09sdf09j90 dfsjifdadisjodjafiosjdafs009dfsja9sdjf09fdas09sdf09j90dfsjifdad isjodjafiosjdafs009dfsja9sdjf09fdas09sdf09j90dfsjifdadisjodjafi osjdafs009dfsja9sdjf09fdas09sdf09j90
- pygy_ 9y agoWhy would `_ENV` slow down LuaJIT? It only offers a subset of the `setfenv()` functionality of Lua 5.1 that's implemented in LuaJIT...
- rweichler 9y agoIt uses lexical scoping, so it probably would mess up traces.
- pygy_ 9y agoLate reply, but so does setfenv: > function foo()return function()return a end end > =foo()() nil > a=5 > =foo()() 5 > setfenv(foo,{a=6}) > =foo()() 6
- rweichler 9y agoNah I'm talking about the _ENV variable itself being in lexical scope.
- rweichler 9y agoi have no idea what im talking about tho.
- pygy_ 9y agoOoooh, maybe this is relevant: > function foo() >> local a = _ENV >> local _ENV = a >> return {a=function() _ENV = {r=6} end, b = function() return r end} >> end > r = 5 > x = foo() > x.b() > =x.b() 5 > return x.a() > return x.b() 6 > vs > function foo() return { a = function() return setfenv(2, {r = 6}) end, b = function() return r end } end > x = foo() > = x.a() bad argument #1 to '?' (invalid level) stack traceback: [builtin#11]: at 0x0101faf2a0 [C]: at 0x0101f4ea60 > function foo() function bar() setfenv(2, {x=6}) end bar() return function() return x end end > e = foo() > =e() 6 I hadn't thought of that...