On 2012-03-29 16:36:55 +0000, Jacob Carlborg <[email protected]> said:
Both I and Michel have created an Objective-C/D bridge that uses this
approach. It lets you call Objective-C methods, create instances of
Objective-C classes, create subclasses in D that inherit from
Objective-C classes and so on. It did this all automatically. The
problem with the bridge was the enormous template bloat. A GUI Hello
World application takes around 60MB with the bridge.
http://www.dsource.org/projects/dstep
http://michelf.com/projects/d-objc-bridge/
All true.
The tricky thing with Objective-C is that you need to subclass
Objective-C classes to make use of Cocoa. It's that mechanism that let
you create a "D subclass" of a Objective-C class that is so
heavyweight, and also not very efficient. Just calling Objective-C code
is relatively easy in D if you don't need to subclass, but it won't
take you very far.
That's why Michel started the DMD fork to directly support binding to
Objective-C classes and methods.
Indeed. And the approach makes much more sense. Only I don't really
have time for compiler hacking these days. I still hope I'll be able to
continue it later this year.
--
Michel Fortin
[email protected]
http://michelf.com/