I gave Lwan some love in its Lua support. With some macro crimes, it's now possible to define new libraries in the Lua environment without a lot of boring boilerplate.
For instance, to define a new lib:
LWAN_LUA_LIB(haiku)
And then to define a function:
LWAN_LUA_LIB_FUNCTION(haiku, is_computer_on)
{
lua_pushboolean(L, 1);
return 1;
}
Lwan.haiku.is_computer_on() will be available in all Lua environments. You can do this outside Lwan, in your user code, too!