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.



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
    static const members
    special alignment and packing
    recursion (pod members)
    C and C++ comments

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