lua-users home
lua-l archive

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

On 5/12/2011 5:09 PM, steve donovan wrote:
On Thu, May 12, 2011 at 11:01 AM, KHMan wrote:
Eh, my memory cells is a failure, a C preprocessor in Lua is probably more
like a 40KB stripped binary chunk. But it's under 20KB without the #if*
conditional syntax and expression parsing. There is quite a lot to

Oh yes, that's the complicated bit!

It's not that bad (though of course it's not trivial either). Once you prune the full C expression grammar to only what the preprocessor supports, it's just a bit more complicated than parsing Lua expressions. Well, except for sizeof()...

Although does it make sense to expect a Lua FFI package to read
implementation C header files?  They are clunky and often depend on
lots of little bits. Much better to have a tool to massage them and
extract exactly what one wants, and include that. Such a tool could
start out by using the standalone C preprocessor as a first step.

A full-featured C preprocessor would be very convenient while a kind of binary chunk equivalent for FFI specifications would be very fast-loading.

Heaven would be the ability to pick either one with minimal fuss. :-)

All we need is some skilled manpower. I guess the 'dream' theme is apt...

Then (for instance) the target system only needs foo, not foo-dev

Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia