lua-users home
lua-l archive

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


> > I've started work on a (not yet public) project that requires Lua to
> > run without any IO / syscall dependencies.
>
> The Lua 5.3 core depends only on these standard C functions:
>
> abort abs floor fmod frexp localeconv longjmp memcmp memcpy pow setjmp
> snprintf strchr strcmp strcoll strcpy strlen strpbrk strspn strtod
> time
>
> Most of these can be written directly in C if needed. Some are hard:
> frexp. Some are impossible: longjmp, setjmp. Some are controlled via
> luaconf.h and l_mathop: floor, food frexp, localeconv, pow, snprintf.
>
> In other words, changing the dependency of the Lua core on libc can be
> mostly done by editing  luaconf.h, as expected.

+1.

We have been using this approach for Lua in Kernel for years. The best
part about this is that new patches apply cleanly or without minimal
changes (usually whitespace related). This way we keep up with
upstream as soon as it's released.