lua-users home
lua-l archive

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


Here is a description of a non-existent Lua library.  No guarantee that it
will be implemented (or released if it is implemented), but thought I'd
present it for criticism.

-John

----

The Lua library podlib allows C "plain old data" (structures consisting of
simple data types) to be accessed easily from Lua.  The design is kept
simple by constraining it to only structure definitions and by use of
platform-dependent ABI information.  Podlib does not provide function
wrapping or global symbol access.

Several alternative exist to podlib.  The tools tolua and luaswig provide
extensive interface wrapping, but require generation and linking of (often
verbose) C code.  Other tools like not-tolua and Luna export interfaces
inline, but require tedious registration of members.

The tool luaffi is another option, and may be thought of as podlib taken to
its extreme.  However luaffi does not include a tool for generating call
interfaces and types from C headers (maybe such a tool exists?), and
requires dynamic library support on the target platform.

Planning to support:
    enum definitions
    arrays
    static const members
    special alignment and packing
    recursion (pod members)
    typedefs
    C and C++ comments

Not planning to support:
    constructors
    static members
    member functions
    inheritance
    bitfields
    vtables or rtti
    nested struct/enum
    C preprocessor directives
    ?? self-reference
    ?? pointers (except char*)