Fragile ABI

Michel Fortin michel.fortin at michelf.ca
Fri Aug 17 04:22:55 PDT 2012


On 2012-08-16 14:58:22 +0000, "R Grocott" <rgrocottbugzilla at gmail.com> said:

> http://michelf.ca/blog/2009/some-ideas-for-dynamic-vtables-in-d/
> 
> The above blog post, written in 2009, proposes a system for solving the 
> Fragile ABI Problem in D. Just wondering whether anything like this is 
> a planned feature for druntime.

I wrote this post. I'd still like to have a non-fragile ABI. But 
there's probably a tradeoff to make: if you want absolute performance, 
a non-fragile ABI will get in your way. If you're writing a GUI 
toolkit, performance probably isn't going to be your biggest concern, 
but if you're writing a game it might.

So I think this problem would be worth solving in a way that allows the 
designer of a class to choose.


> It would be nice if D could sidestep this issue. It's frustrating that 
> C is currently the only real option for developing native libraries 
> without worrying about their ABI.

It's frustrating indeed.

The D/Objective-C proof of concept I developed is interesting in this 
regard: extern(Objective-C) classes have a non-fragile ABI (for 
methods, and for fields too if I add support for Apple's modern 
runtime). So basically you have fragile and non-fragile objects living 
together, using two distinct class hierarchies. The extern(Objective-C) 
hierarchy being the non-fragile one, but slightly slower too.


-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca/



More information about the Digitalmars-d mailing list