Page 1 of 1

Why isn't Love 0.8.0 on Lua 5.2?

Posted: Sun Mar 11, 2012 9:02 am
by YellowAfterlife
This might be a somewhat rhetorical question, but anyway. Why doesn't it?

Lua 5.2 brings in such new features as bit32 library and goto statements.

goto statements are evil. But cool, because you can substitute a lot of features from other programming languages with them. Also you can accidentally make your code look extremely awkward if over-using these. But that's another story.

bit32 library adds bitwise operators. Bitwise operations are cool. And fast. And you can fit up to 32 'boolean' values into single number, which is extremely useful for organizing grid-based levels. Current workarounds include splitting number into a 32-element array (which means allocating 32x more memory for every, and harder conversions) or abusing modulo and math.floor on division to split few bits (which is quite bad, and works slowly).

Re: Why isn't Love 0.8.0 on Lua 5.2?

Posted: Sun Mar 11, 2012 11:07 am
by pk
viewtopic.php?f=3&t=5561

Basically, it's too early. Maybe next release.

Re: Why isn't Love 0.8.0 on Lua 5.2?

Posted: Sun Mar 11, 2012 1:22 pm
by thelinx
YellowAfterlife wrote: goto statements are evil
A common misconception.

goto isn't evil, bad program design is

Re: Why isn't Love 0.8.0 on Lua 5.2?

Posted: Mon Mar 12, 2012 12:55 am
by YellowAfterlife
thelinx wrote:
YellowAfterlife wrote: goto statements are evil
A common misconception.

goto isn't evil, bad program design is
Well, it is rather obvious that it is not actually evil, and on lowest level everything else is organized upon it, but I decided to go with that to not get thread going off the topic too early. Well, it did anyway.

Some languages do not have actual control structures, leaving only goto's to organize logic. Mostly these also have a call\return statements, first of which is essentially a goto with current position being pushed to stack.

"Evilness" in this case comes from fact that many do not notice a border between just removing unneeded iterations and condition wraps and turning code into barely readable mass that gives suspects that program was built from disassembled low-level commands.

On-topic, will wait if it's too early. Also could say that linked topic ended a bit too early, with author linking to fork that he did to fix things.

Re: Why isn't Love 0.8.0 on Lua 5.2?

Posted: Mon Mar 12, 2012 10:48 am
by miko
YellowAfterlife wrote:This might be a somewhat rhetorical question, but anyway. Why doesn't it?

Lua 5.2 brings in such new features as bit32 library and goto statements.

goto statements are evil. But cool, because you can substitute a lot of features from other programming languages with them. Also you can accidentally make your code look extremely awkward if over-using these. But that's another story.

bit32 library adds bitwise operators. Bitwise operations are cool. And fast. And you can fit up to 32 'boolean' values into single number, which is extremely useful for organizing grid-based levels. Current workarounds include splitting number into a 32-element array (which means allocating 32x more memory for every, and harder conversions) or abusing modulo and math.floor on division to split few bits (which is quite bad, and works slowly).
I don't care about goto, but for bit lib you can use luajit. And it will be way faster than lua 5.2 could ever be.

Re: Why isn't Love 0.8.0 on Lua 5.2?

Posted: Tue Mar 13, 2012 2:34 am
by Inny
Lua 5.2 is the bleeding edge release which will take a year for adoption to spread, and 5.1.5 is the official currently supported legacy version from PUC-Rio. Lua 5.2 introduces a small handful on incompatible features with 5.1 code that would be problematic and make a ton of existing lua tools and libraries broken. So yeah, it's basically too new.

As for the goto statement, thats a can of worms that PUC-Rio opened ;). I'll allow that "bad program design is evil, not goto", but it's been long known that the goto keyword should be rarely if ever used, and that the whole point of the break and continue keywords was to eliminate 99.9% of cases where you could use goto.

Re: Why isn't Love 0.8.0 on Lua 5.2?

Posted: Tue Mar 13, 2012 3:28 am
by Xgoff
Inny wrote:Lua 5.2 is the bleeding edge release which will take a year for adoption to spread, and 5.1.5 is the official currently supported legacy version from PUC-Rio. Lua 5.2 introduces a small handful on incompatible features with 5.1 code that would be problematic and make a ton of existing lua tools and libraries broken. So yeah, it's basically too new.
i'd imagine that the main reason 5.2 isn't being adopted all that quickly is because apart from the bc breaking, it doesn't really have any killer features. the two big features are the bit library and removal of many coroutine yielding restrictions... problem is both of those have been available to 5.1 for years

i wouldnt worry about goto too much since it was mainly wanted for things like code generation and error handling. it also replaces some uses for tail calls since it's cheaper. and, like one of lua's authors mentioned: at least they aren't continuations ;)
Inny wrote:that the whole point of the break and continue keywords was to eliminate 99.9% of cases where you could use goto
technically, goto follows lua's tendency to eliminate cruft. since break and continue are just special cases of goto, it makes sense to just use the more general version. plus, continue has the problem of wonky semantics with locals with the repeat until loop. so does goto, but they changed the definition of scope to account for that. of course they could have done the same with continue but i guess the goto way was more elegant (better to say "scope ends at a label if there are no further uses of the variable" than say the same about continue but not for break)