beyond-all-reason / beyond-all-reason/RecoilEngine

Maybe upgrade lua to 5.4

Open
#2,295 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

Not totally sure it's a good idea, but opening this issue to start gathering information, comments, objections...

This would probably be a huge task, but could maybe reap some benefits in the form of more updated api, maybe perf improvements (or regressions who knows XD), true integer support, native bit operations... didn't look at the full list but likely has some interesting stuff.

The drawback is our version is quite custom atm, so applying all changes done over the years would probably be quite hard, error prone, open to new desyncs, and who knows what other dangerous issues lie here.

I believe currently we're at 5.1 with some backported features from 5.2+.

### Lua changelog:

- 5.2: [Lua 5.2](https://www.lua.org/manual/5.2/contents.html) was released on 16 Dec 2011. Its [main new features](https://www.lua.org/manual/5.2/readme.html#changes) were yieldable pcall and metamethods, new lexical scheme for globals, ephemeron tables, new library for bitwise operations, light C functions, emergency garbage collector, goto statement, and finalizers for tables.
- 5.3: [Lua 5.3](https://www.lua.org/manual/5.3/contents.html) was released on 12 Jan 2015. Its [main new features](https://www.lua.org/manual/5.3/readme.html#changes) were integers, bitwise operators, a basic utf-8 library, and support for both 64-bit and 32-bit platforms.
- 5.4: [Lua 5.4](https://www.lua.org/manual/5.4/contents.html) was released on 29 Jun 2020. Its [main new features](https://www.lua.org/manual/5.4/readme.html#changes) are a new generational mode for garbage collection and const and to-be-closed variables.

### References

* Related issue: [Document current Lua support](https://github.com/beyond-all-reason/RecoilEngine/issues/2299)
* [Performance comparison](https://eklausmeier.goip.de/blog/2020/05-14-performance-comparison-pallene-vs-lua-5-1-5-2-5-3-5-4-vs-c/)
* [Lua-Benchmarks](https://github.com/gligneul/Lua-Benchmarks)
* [Panelle](https://github.com/pallene-lang/pallene) Pallene is a statically typed and ahead-of-time compiled sister language to [Lua](https://www.lua.org/), with a focus on performance (somehow related).
* [5.2 breaking changes](https://www.lua.org/manual/5.2/readme.html#changes)
* [5.3 breaking changes](https://www.lua.org/manual/5.3/manual.html#8)
* [5.4 breaking changes](https://www.lua.org/manual/5.4/manual.html#8)

Contributor guide

Open the contributing guide

Research direction

The issue names no repository files or tests. Start with the related “Document current Lua support” issue and inventory the engine’s custom Lua 5.1 implementation and backported features against the linked Lua 5.2–5.4 changelogs. Done would be an agreed, evidence-backed upgrade plan or an explicit decision not to proceed.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.