luajit-ffi
so
so at so.so
Tue May 1 08:50:36 PDT 2012
On Tuesday, 1 May 2012 at 15:32:40 UTC, Alex Rønne Petersen
wrote:
> On 01-05-2012 17: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?
>
> Parsing a C header is relatively easy; don't need a full
> compiler for that. It's what htod does. I don't know what you
> mean by "manual bindings", but keep in mind that:
>
> 1) We *don't* want to embed some kind of crazy C syntax in D.
> 2) In D, we want statically bound C function calls. Lua is a
> dynamic language.
It has nothing to do with syntax, D already can call C functions
directly,
and have all the structures.
> 3) LuaJIT will have the same problems as htod: Preprocessor
> definitions.
We can just support enum and simple alias capabilities of C PP
and most if not all the popular C libraries would be in D
arsenal. I haven't seen many serious C APIs that exploit PP more
than these simple tasks.
More information about the Digitalmars-d
mailing list