lua-users home
lua-l archive

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


Given the recent interest in binding Lua to C, I thought the
following, rough and ready as it is, may be of interest.

I'm pleased to announce Squeeze, the friendly alien:

https://github.com/rrthomas/squeeze

squeeze uses the output of ctypesgen-json, which parses C headers into JSON:

https://github.com/rrthomas/ctypesgen-json

(ctypesgen-json is a modified version of ctypesgen, which parses C
headers into Python.)

So far, I have done minimal testing: ctypesgen-json successfully
generates JSON for my system's stdlib.h, which squeeze can load.
Having done this, I can run drand48(). This is about as early as
releasing gets!

My own use-case for this is generating C bindings for the Lua version
of GNU Zile:

http://git.savannah.gnu.org/cgit/zile.git/log/?h=lua

Currently, Zile uses luaposix, lrexlib and lcurses, all of which I
maintain or co-maintain. Maintaining the C is a drag, and, much worse,
needing to download and install these libraries is a drag for users
who want to build Zile. I want to replace all of them with alien. I am
not sure yet how much mileage there is in this idea, but I intend to
find out now that I have squeeze.

-- 
http://rrt.sc3d.org