-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Related Issue
- Unified loading and saving code to RAM and LFS #2917 Unified loading and saving code to RAM and LFS
- Concerned about moving parts of modules into Lua #3128 Concerned about moving parts of modules into Lua
- WIP: Rewrite sntp in Lua with only a little C #2819 Rewrite sntp in Lua with only a little C
Background
Currently we can only embed C modules in the firmware binary. @nwf has been developing the concept of hybrid C+Lua modules. @pjsg has raised a concern in #3128 about this increasing the barriers to entry and RAM use for new developers who are unfamiliar with the added complexity of LFS. Both @nwf and @HHHartmann have discussed the concepts for a firmware-embedded LFS partition which would allow use to package C, Lua and C/Lua hybrid modules automatically at build time. The more I consider this, the more I support this general concept as this would allow use to increase the out-of-box capability for new developers.
The rub is that there are technical reasons why this would involve quite a bit of Lua VM runtime changes in the case of the Lua51 VM -- changes which I have already made to the Lua53 VM, which brings us to the policy issue.
When do we deprecate the Lua 5.1 runtime?
At the moment make LUA=53
builds a Lua 5.3 based firmware image and the default make
builds a Lua 5.1 image. Both work, but the Lua 5.3 engine is cleaner, faster, and more RAM-efficient. I have already re-implemented the dump/undump LC/IMG file format for Lua53 to facilitate new features such as Nathaniel and Gregor propose.
Back-porting new Lua 5.3 stuff into Lua 5.1 takes effort and introduces extra maintenance overheads. My view is that we need to move to a policy of only offering new VM features within the Lua 5.3 engine and we treat the Lua 5.1 engine as offering continuity options for legacy support. I feel that we need an active consensus on this and this is why I am opening this issue to seek this policy change.