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
ffi
andjit
packages 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.path
is automatically updated to include the waywall configuration directory, so you canrequire()
other files contained within it.pcall
andxpcall
have been modified to prevent user code from disabling the instruction count limit by accident.print
has been modified so that its output appears in a similar format to other waywall log messages.os.setenv
is a new function added by waywall which behaves much like C'ssetenv()
and allows for changing and deleting environment variables.- Calling
os.setenv
with two strings (a name and value) will behave like C'ssetenv()
. - Calling
os.setenv
with 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
, andloadstring
are not available
You can refer to the startup code to see all of the changes waywall makes in more detail.