D vs C++

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Dec 27 14:16:54 PST 2010


On 12/27/10 3:19 PM, "Jérôme M. Berger" wrote:
> spir wrote:
>> On Sun, 26 Dec 2010 22:44:04 +0100
>> "Jérôme M. Berger"<jeberger at free.fr>  wrote:
>>
>>>> 8. direct interface to C
>>> Cython gives it too: it is as easy to write a Cython interface
>>> module as to write a D interface file for a C library.
>>
>> Hum, I do not agree at all. As I see it, D binds to C directly, Lua binds to C rather easily, Python binds to C "complicatedly". (Lua's C interface layer is far simpler than Python's, but it still cannot compare to D's direct calls in both directions. The only issue AFAIK is that types, qualifiers and conventions do not exactly match.)
>>
>
> cdef extern double fooC (int bar)
> def fooPy (bar):
>      return fooC (bar)
>
> 	I don't know how Lua binds to C, but I doubt it is any easier. Or
> you could use swig which is even easier.
>
> 		Jerome

How would one be able to pass pointers around?

Andrei


More information about the Digitalmars-d mailing list