One of the best features I liked about Objective-C when it first really hit the scene (with NeXT computers) was method forwarding. Lua has __call metamethod, and having reflection just gives you one more interesting tool to use.
For me, the use cases fall into two categories,
At this moment, having the maximum capabilities seems better than going skimpy trying to satisfy a particular scenario. Over time, obvious uses will emerge, and the interface can evolve and mature, but it's adolescent, so I'd say, just let it run free and wild.
One interesting use case that mixes serialization and remote invocation is taking the function call information (along with the data structures) and automatically creating a serialized remote invocation call. Take a drawing package, based on GDI or OpenGL perhaps. Given the specifications in C, I can now automatically generate a package that encapsulates a function call, sends it across to someone, they can unpack it, and call the function.
I don't have to write any code on either end to do this (other than the C declarations, which already exist in the header). And, given the size of these APIs, that's a huge win.
Keep up the great work!
- Shaping clay is easier than digging it out of the ground.
> Date: Sat, 2 Jun 2012 16:09:50 +0300
> From: alex-jUE9FD3ILm5BDgjK7y7TUQ@public.gmane.org
> To: luajit-uGLqWuYN4qMgsBAKwltoeQ@public.gmane.org
> CC: corsix-F2hBSiM+zxwdnm+yROfE0A@public.gmane.org
> Subject: Re: FFI Reflection
> Great start! Thank you!
> I suppose that FFI+Refletion will serve as basis for bunch of new, cool
> serialization tools [*].
> Personally, I am going to utilize the API for a several experiments with
> the sqlite bytecode (VDBE ) next weekends
> Kind Regards,
>  http://www.sqlite.org/cgi/src/artifact/87b8ff40?ln=37-75
> [*] LuaJIT FFI+Reflection means possibility of the light, easy,
> efficient and portable serialization of the native data structures to
> the current message formats. (actually, the first *really* easy and
> right solution for real life C data graphs AFAIK).
> IMO, this feature gives the practical chance for the users of many
> proven C libs to evolve and expand their cases according today's message
> oriented designs.
> I am very optimistic about the above application popularity, once the
> first "cool" sample makes his way to the "front pages"