On 2012-07-12 13:01:42 +0000, "bearophile" <[email protected]> said:
Jacob Carlborg:
Yeah, that was insane. 60 MB for a hello world application is not pretty.
I'd like to know how much MB are saved using the @templated()
pervasively in that first implementation... :-)
There's no use for @templated() in the bridge. Classes wrappers and
function wrappers are not templates, they're mixins. You end up with a
lot of non-templated virtual functions in each class.
The second version is not a bridge, it changes the language to be ABI
compatible with Objective-C.<
I vaguely remember a language that allows to specify a custom
calling convention from the language itself. I don't know if this
general feature is worth adding to D.
But you don't even need a custom calling convention to call Objective-C
code in D (hence why the previous approach with the bridge worked!).
Objective-C method use the same calling convention as variadic C
functions.
D/Objective-C (the compiler addition) is much more than that. It's
support and cohabitation of a second object ABI, it's support for
Objective-C exceptions mixed with D exceptions, support for Objective-C
string and selector literals, class objects and overridable class
methods, overriding, contracts added to the Objective-C object model,
Objective-C protocols (through interfaces), plus a few other things
which haven't been implemented at this time.
--
Michel Fortin
[email protected]
http://michelf.com/