wangqr / Aegisub

Win64 nightly builds available at GHA artifact, also at following link:
https://ftp.wangqr.tk/aegisub/
Other
795 stars 49 forks source link

How to upgrade lua #15

Closed wangqr closed 4 years ago

wangqr commented 5 years ago

Lua is a script language designed to be embedded in another program. In our case, Lua is embedded as the automation engine for aegisub (see libaegisub/lua). So lua is small, easy integration with other code, and NOT version compatible. It is designed not to be upgraded over time.

But, older versions will eventually die out, and no longer maintained. There is no clear timeline when a version of lua is supported and will get security fix, and we need to figure it out and make our decision.

Here's some useful informations:

lua versions still used by some maintained distros:

Version Last release version Last release date Still maintained
lua50 5.0.3 2006-06-26 No
lua51 5.1.5 2012-02-17 No
luajit-2.0 2.0.5 (5.1.4) 2017-05-01 Unknown, seems no
luajit-2.1 2.1.0-beta3 (5.1.4) 2017-05-01 Unknown, seems yes
lua52 5.2.4 2015-05-07 No
lua53 5.3.5 2018-07-10 Yes
lua54 5.4.0-alpha-rc2 2019-06-06 Yes

In 2cb92a5f74634764ff5aac7e3ad0d647f98142af we are using LuaJIT-2.0.4 with LUAJIT_ENABLE_LUA52COMPAT enabled (yes this also breaks compatibility and not much distros enable this in their shipped version of LuaJIT). So a low risk thing we can do is to upgrade the bundled LuaJIT to luajit-2.1 and still build it with LUAJIT_ENABLE_LUA52COMPAT. To move forward, we might want to migrate back to lua itself.

Lua libraries used by Aegisub:

Library Last release version Last release date Still maintained Comment
luabins 0.3 2010-05-27 No Bundled version is latest version. No update on git since then.
LPeg 1.0.2 2019-03-11 Yes Bundled version is v0.10
moonscript 0.5.0 2016-09-25 Yes Bundled version is leafo/moonscript@491f2352a238c4cbfe141c6aa80b3eb4cc9713f5. Some other libs are dep of moonscript. How to update is described in README
LuaFileSystem 1.7.0 2017-09-15 Yes Not bundled. An partial implementation of its interface is included.

And we also have re and unicode, which are wrapper for boost functions.

The whole thing that prevents us from upgrading Lua is we do not know what functions are used by people in their code, and whether upgrading Lua will break it. We might want to check if upgrading Lua (say, to lua53 or lua54) will break anything in the automation folder first, and search for scripts and see if them break.

Providing download links to Aegisub Lua plugins in this issue would be really helpful.

aniolm9 commented 5 years ago

I have spoken to some colleagues and they sent me a bunch (183) of Lua scripts they use. Is it fine if I attach here a zip file with them?

wangqr commented 5 years ago

Sure. But this issue is low priority on my list

aniolm9 commented 5 years ago

Sure, it's not critical. The scripts: https://github.com/wangqr/Aegisub/files/3596042/scripts.zip

MadokaAyukawa commented 5 years ago

Thanks for the scripts. Is there any documentation for them somewhere online?

Zabrr commented 5 years ago

The scripts: https://github.com/wangqr/Aegisub/files/3596042/scripts.zip

A lot of scripts in this archive are outdated. For example, the last versions for unanimated scripts can be found here http://unanimated.hostfree.pw/ts/scripts.htm . And there are link for other authors scripts https://github.com/TypesettingTools . I think, that lua should be updated to the latest version, and the authors should be responsible for the performance of the scripts. I will update all my scripts (https://yadi.sk/d/DPu3_GT23Zi9vz) myself, after the lua upgrade.

wangqr commented 5 years ago

Yutils use the ffi.* which is LuaJIT only. https://github.com/facebookarchive/luaffifb looks like an alternative.

wangqr commented 4 years ago

No further plan to upgrade lua, close for now.