Plans on supporting Lua 5.2+ for HTML5/iOS?

Hello there,

The lack of continue keyword on Lua 5.1 really bothers me when targetting HTML5 or iOS. The workarounds for enabling a continue-like on Lua 5.1 can result in sort of incomprehensible code.

When researching for alternatives to continue, you’ll find:

  • using goto (which also do not work on HTML5/iOS)
  • wrapping the code in repeat/until true, and break it - which doesn’t let you break the outer loop unless you have a variable to flag and break yourself in the outer scope.

I know this must be no easy task given the dimensions of Defold’s codebase. Just wanted to shout out here.

Cheers!

2 Likes

It would make visual novels a little easier to make. :slight_smile:

1 Like

I’m afraid this is something that unlikely to happen any time soon. We want as few discrepancies as possible between the Lua implementations that we use and Lua 5.1 and LuaJIT is in all honesty the best choice here. We rely heavily on LuaJIT to give us a much needed performance boost for Lua code, and as long as LuaJIT is more like Lua 5.1 than it is 5.2 we will stick with 5.1. We are in the process of updating LuaJIT so that it can be run on ARM64 meaning also iOS devices (albeit with jit disabled). HTML5 will still run Lua 5.1 though.

4 Likes