[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Microlight (was Re: paving cowpaths with libraries)
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 17 Feb 2012 13:06:57 +0200
On Fri, Feb 17, 2012 at 9:34 AM, Xavier Wang <weasley.wx@gmail.com> wrote:
> penlight? but it's maybe too big for someone :-)
There's a lot of code, sure, but I've tried to make modules
self-sufficient. The core (things like pl.path,pl.dir etc) is not big
and does not depend on anything except pl.utils.
> not only for fast, e.g. implement bind in C will very easy and needn't
> any table allocation.
That is true, but will people notice the difference?
> ml.vararg is the same. and it can be compiled
> into a big program -- just like game core. sometimes we need only
> scripts for logical, and support library are all in one executable
> file.
I find the ml.vararg very interesting, and C is the way to get
efficient implementations for varargs.
Otherise, it's easy to add a C module. But not so difficult to
precompile Lua code or even wrap as loadable code in a C module. bin2c
takes luac output and packages it as C, but a more portable approach
is to format the code as a big C string and load that. I used that in
winapi to add a few functions which were easier to write in Lua.
And LuaJIT can actually compile Lua code into object files that can be
linked with an application. (a cool thing about LuaJIT bytecode is
that it is platform-independent)
steve d.