Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: chief1983 on March 13, 2017, 11:45:51 am

Title: Transition to 5.3
Post by: chief1983 on March 13, 2017, 11:45:51 am
Are we going to do this?  It seems like more and more distributions are only keeping 5.1 packages around for compatibility reasons, but I can't expect that to continue forever.  Is it time to start planning what we might be able to do to move forward with our Lua support?  What kind of questions are there to be asked and answered on this subject?  I can think of a few at least.


Just not sure how much longer we can keep our heads buried in the sand with this one, thought maybe we should have some dialogue on the subject.
Title: Re: Transition to 5.3
Post by: m!m on March 13, 2017, 12:05:55 pm
  • Just how incompatible is 5.3 with 5.1?
There are some changes that may break existing scripts. Some special Lua functions don't exist anymore or have changed their meaning.

  • Does the engine code that hooks into Lua do anything that is incompatible with Lua 5.3 itself?
The engine code is not the problem since we can always change that to be compatible again. There are some minor changes to the C API but nothing that can't be fixed by a few code changes.

  • What kind of effort would be needed to migrate existing scripts?  Are we talking major community wide effort to try to reach all the bases?
Since the existing scripts are within released mods there is not much we can do to fix them. We could do community patches for those mods but if there are source incompatibilities then that general issue can't be fixed.

  • Will there be any way for mods to maintain support for both older and newer builds with different Lua versions?
The Lua scripts can check the Lua version and check if some required function exists to maintain compatibility with newer or older Lua versions.

  • Could we try to link both interpreters and allow a transitional period where we support both Lua 5.1 and Lua 5.3 scripts?
Unless we put the different Lua interpreters into DLLs and then manually load the API functions from the correct DLL it will not be possible to keep both versions in the same executable.

Also, if we move to 5.3 we lose the ability to switch to LuaJIT if we ever want to do that. I don't think is is a big issue since we can always compile Lua 5.1 as part or our build if the system does not have that library.
Title: Re: Transition to 5.3
Post by: Axem on March 13, 2017, 05:22:02 pm
What changes were there exactly that could break previous scripts? I couldn't find much in the way of that in the 5.3 (https://www.lua.org/manual/5.3/readme.html#changes) and 5.2 (https://www.lua.org/manual/5.2/readme.html#changes) readme change lists.
Title: Re: Transition to 5.3
Post by: m!m on March 14, 2017, 08:33:40 am
The pages you linked to also contain a section about incompatibilities with previous versions:
5.1 -> 5.2: https://www.lua.org/manual/5.2/manual.html#8
5.2 -> 5.3: https://www.lua.org/manual/5.3/manual.html#8
Title: Re: Transition to 5.3
Post by: Axem on March 14, 2017, 09:47:45 am
Haha... Wow I can't read. :nono: