Requesting D ABI clarifications

pragma pragma_member at pathlink.com
Thu May 11 10:40:32 PDT 2006


In article <e3vos6$1quk$1 at digitaldaemon.com>, Sean Kelly says...
>
>pragma wrote:
>> Well, I do know that there are some variations in how D is supported across
>> Windows and Linux.  I say this because Walter himself seems rather dubious that
>> aiming for cross-platform runtime linking (ala DDL) is "folly" since there are
>> subtle differences.  While I'd like to maintain that this only applies under
>> certain circumstances, I honestly don't know what the baseline for binary
>> compatiblity really is.
>
>Ideally, it should be that libraries can be built with one compiler and 
>linked against code compiled with another.  At the very least, this 
>suggests that object layout, function calling conventions, and exception 
>handling should be standardized for any specific platform.

Agreed.  Again, I wish there was a firm statement in the ABI covering these
points.  Personally, I consider all of those points a "must have" as it makes
writing a third-party D compiler almost impossible (as Gregor has demonstrated).

>> B) If memory serves, I think Walter went on the record as saying that the
>> exception handling mechanisms are *different* between win32 and linux (the
>> latter having to do with GDC/GDB compatibility I guess).  I hope I'm wrong about
>> that, as this just seems to make life harder than necessary.  IMNSHO, using
>> separate SEH mechanisms kind of ruins the idea of a true ABI.
>
>While I think this is certainly possible, it would be somewhat more 
>difficult as you wouldn't be able to use Windows SEH.  

Right, the compiler would have to include some kind of thunk between D's
standard exception handling and the native exception handling (for one or more
platforms, depending on what that standard is) when calling extern(C) and
extern(Windows) functions.  So there'd be an efficency loss in some places for
talking with legacy code, but D-to-D calls would work just fine.

>But perhaps 
>binary compatibility between Windows and Unix platforms isn't a 
>tremendous concern?

I guess it depends on what folks really want. :)

>From where I'm standing its seems like a "nobody's concerned because they don't
have it yet" kind of thing.  Granted, that's just unsubstantiated opinion, but I
cannot fathom developers actively rejecting the idea were it suddenly made
practical.

- EricAnderton at yahoo



More information about the Digitalmars-d mailing list