luajit-ffi

Alex Rønne Petersen xtzgzorex at gmail.com
Tue May 1 08:36:52 PDT 2012


On 01-05-2012 17:31, Robert Clipsham wrote:
> On 01/05/2012 16:24, so wrote:
>> http://luajit.org/ext_ffi.html
>> https://github.com/malkia/ufo
>>
>> How awesome is Mike Pall?
>> I didn't dive into details of the code, but if he can do this with a
>> dynamic language, why on earth D still need manual C bindings while
>> having ABI compatibility? So luajit comes with a C compiler?
>
> Note that you can't just drop any C header file in there for that to
> work (as far as I can tell), you still have to bring out individual
> post-processed function declarations.

Note in particular that the message box example used a preprocessed 
version of the MessageBoxA declaration.

>
> Also, someone has written a libffi binding for D, which could probably
> be adapted to work in a similar manor:
>
> https://github.com/lycus/libffi-d
>

If you have a C parser (libclang?), it's probably entirely doable.

-- 
- Alex


More information about the Digitalmars-d mailing list