Compiling With Lua 5.2 Compatibility

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Compiling With Lua 5.2 Compatibility

Post by ejmr »

Now that LÖVE uses LuaJIT, has anyone compiled it with the -DLUAJIT_ENABLE_LUA52COMPAT flag? I was thinking about do so as an experiment but first wanted to ask if anyone else had already tried, and if so what problems they ran into when attempting to run existing LÖVE games.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Compiling With Lua 5.2 Compatibility

Post by ejmr »

I haven’t yet done extensive testing, but LÖVE compiles with LuaJIT’s 5.2 compatibility flag without any problems.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: Compiling With Lua 5.2 Compatibility

Post by Xgoff »

just keep in mind that it is far from complete compatibility
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Compiling With Lua 5.2 Compatibility

Post by ejmr »

I am aware. But it is nice to be able to use 'goto'. :gasp:

lol
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
User avatar
slime
Solid Snayke
Posts: 3170
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Compiling With Lua 5.2 Compatibility

Post by slime »

LuaJIT actually lets you use goto without compiling with the -DLUAJIT_ENABLE_LUA52COMPAT flag. See http://luajit.org/extensions.html#lua52 .
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Compiling With Lua 5.2 Compatibility

Post by ejmr »

That is true. I simply have the habit of associating it with the flag so that ’goto’ is treated as a keyword.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Compiling With Lua 5.2 Compatibility

Post by bartbes »

I'm fairly sure we went ahead and made love compile against lua 5.2 (at least in compat mode) somewhere before the 0.9.0 release.
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Compiling With Lua 5.2 Compatibility

Post by ejmr »

Thanks for the info bartbes. Is there any plan to continue to do so, i.e. official support, or was it instead simply experimentation? Personally, now with LuaJIT being the foundation I do not see tremendous benefits in also maintaining compatibility with Lua 5.2, but it would be nice if the upkeep wasn't difficult.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Compiling With Lua 5.2 Compatibility

Post by Inny »

I'd just like to make the piercing jab that bad use of the goto statement has been the underlying cause of two recently discovered dramatic security flaws.
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: Compiling With Lua 5.2 Compatibility

Post by Xgoff »

Inny wrote:I'd just like to make the piercing jab that bad use of the goto statement has been the underlying cause of two recently discovered dramatic security flaws.
not really, the apple bug was mainly the result of not using braces around the if statements, possibly due to a merge/copy+paste error i would guess. in this particular case, they should have just put that freeing code in a function and tailcalled it, but this bug would have happened if eg they had set a "fail" variable instead... 'cause you know, having more than one return statement from a function is almost as bad as goto!!! also i imagine their compiler would have--and SHOULD have--caught this

the tls bug may well still have happened if they had used another method; if you had written code to jump to the wrong label, you probably would have used the wrong function call or return value or whatever, too

tl;dr goto in code, must be source of all problems
</offtopic>
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests