tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [patch] put Lua standard libraries into the kernel

Am 28.11.13 22:17, schrieb Alexander Nasonov:
> Marc Balmer wrote:
>> Am 27.11.13 22:23, schrieb Martin Husemann:
>>> Can't it be a per-state option, passed by luactl when creating the state?
>> That is actually an excellent idea.  So what should be the default,
>> stdlibs enabled or not enabled?
> I'm a bit late to join the conversation but I wanted to emphasize one
> quite important thing:
> Please keep look & feel of plain userspace Lua even in the kernel space.
> If you look at NetBSD C code in the kernel, and compare it with some
> other's OS kernel code, NetBSD code will likely look more natural.
> I hope that one day we can say the same about Lua code in NetBSD.
> There is no need to invent new things if they're already provided by the
> languange.
> So, I don't think we need a special sysctl to control loading of standard
> libraries. Lua already gives you luaL_openlibs() and luaL_requiref().

Jzst to clarify what the discussion was about:  The sysctl variable, or
flag passed to lua(4) when using luactl(8) to create a new Lua state,
only indicates whether the standard libraries should be provided to the
newly created state or not.

If they are, then of course the standard functions like luaL_openlibs()
are used.  So this not about a replacement mechanism for
luaL_openlibs(), but to control whether luaL_openlibs() is called or not.

If the standard libraries should be a separate kmod or if the code
should just reside in lua(4) is another question.

Home | Main Index | Thread Index | Old Index