RE: Common FFI declarations

  • From: William Adams <william_a_adams@xxxxxxx>
  • To: <luajit@xxxxxxxxxxxxx>
  • Date: Wed, 9 May 2012 18:55:57 +0000

Ah, ok, this crystalizes it for me. What's needed is an optional module that 
goes and looks at CState and "does the needful".  If you want to use it, then 
require the module.  If you don't, then don't. I'll look into that.  I already 
have an ffi for Lua51.dll.  Perhaps a few more xports and we're all set? -- 
William

===============================

- Shaping clay is easier than digging it out of the ground.


http://williamaadams.wordpress.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams
 

 > Date: Wed, 9 May 2012 20:02:26 +0200
> From: mike-1205@xxxxxxxxxx
> To: luajit@xxxxxxxxxxxxx
> Subject: Re: Common FFI declarations
> 
> William Adams wrote:
> > I can ask for field offsets once I know field names, but I can't
> > ask for all the field names can I? [...] Perhaps this represents
> > a feature request on my part.
> 
> Well, the info is all there. You'd need to have a pointer to the
> CTState root and then pick the internal structures apart, using
> the FFI of course. :-)
> 
> Ok, so that isn't exactly easy, even if you take a look at
> src/lj_ctype.h. IMHO a user-friendly reflection API for the FFI is
> a bit too costly to have in the core. There's a reason LuaJIT is
> substantially smaller than a regular JVM or CLR installation.
> 
> > Don't you think the 'meta' description Duncan uses for COM is
> > down a similar path?
> 
> I think he just didn't want to write down the highly redundant
> vtables by hand. Of course, this is meta-programming, but something
> completely different. If you look closer, the list of argument
> types is just a string that's copied around. There's no inspection
> of types, nor any reflection needed.
> 
> [And I agree, starting from the IDL is probably the way to go.]
> 
> --Mike
> 
                                          

Other related posts: