Why Ruby?

Jacob Carlborg doob at me.com
Mon Dec 20 09:50:47 PST 2010


On 2010-12-19 22:02, Michel Fortin wrote:
> On 2010-12-19 11:11:03 -0500, Jacob Carlborg <doob at me.com> said:
>
>> I can clearly see that you haven't used an Objective-C/D bridge. The
>> reason (or at least one of the reasons) for which Michel Fortin (as
>> well as I) gave up the Objective-C/D bridge and started to modify DMD
>> is template bloat. I'm not saying that using template strings as
>> lambdas is going to bloat your executable/library as much as the
>> bridge does but I always think twice before adding a template to my code.
>
> I also want to add that the code bloat in the D/Objective-C bridge was
> more because the bridge needed to create two stubs for each method in
> all Cocoa classes, and those stubs contained code to translate
> exceptions from one model to the other. Using templates and mixins made
> the creation of those stubs easy, but I don't think another method of
> generating these stubs would have faired better.

I was thinking about having the tool that creates the bindings 
generating all the necessary code inline and skip all the templates, 
just to see if there would be a difference in the speed of the 
compilation and the size of the generated binaries.

> So the bloat came from the approach (generating stubs for everything)
> much more than the implementation choice (templates). The new approach
> is to avoid having to generate stubs by exposing directly the
> Objective-C objects rather than wrappers around them. Less wrapping,
> less bloat.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list