Lua changes
waywall makes use of LuaJIT, an alternative implementation of Lua 5.1 which provides better performance and additional functionality. A list of LuaJIT's additions is available here.
Note: The
ffiandjitpackages from LuaJIT are not available in waywall.
Instruction count limit
waywall will allow a maximum of 50 million Lua instructions to be executed when it calls into user code (e.g. actions). This limit is in place to prevent buggy configurations from hard-locking waywall.
If this limit is exceeded, an error will be thrown, causing Lua execution to
stop. This error cannot be caught with pcall or xpcall.
Enabling the JIT may cause the instruction limit to behave inconsistently. If your configuration has infinite loops, waywall may freeze permanently.
Standard library changes
waywall makes a few changes and additions to the Lua standard library:
package.pathis automatically updated to include the waywall configuration directory, so you canrequire()other files contained within it.pcallandxpcallhave been modified to prevent user code from disabling the instruction count limit by accident.printhas been modified so that its output appears in a similar format to other waywall log messages.os.setenvis a new function added by waywall which behaves much like C'ssetenv()and allows for changing and deleting environment variables.- Calling
os.setenvwith two strings (a name and value) will behave like C'ssetenv(). - Calling
os.setenvwith a string and nil will unset the given environment variable.
- Calling
There are also a few breaking changes, which are mostly intended to prevent user code from causing problems within waywall's address space:
load,loadfile, andloadstringare not available
You can refer to the startup code to see all of the changes waywall makes in more detail.