D Design Could Be Improved

Don Clugston dac at nospam.com.au
Sun Dec 17 09:13:44 PST 2006


John Demme wrote:
> Specifies the this document only describes the x86 implementation of the
> inline assembler.  I would suggest it go further and specify that it only
> describes DMD's x86 implementation.  Since D is designed to be
> cross-platform, anything at the assembly or linking level should be
> implementation specific, IMO.  This way, D compilers (even ones with x86
> targets) can use whatever asm syntax they like.

Absolutely false. it is very important that the ASM syntax be consistent 
for a single processor. This is another one of those things that C got 
horribly wrong, and that D is getting right.
It's really ridiculous that the GCC syntax for x86 asm even exists.

> Another thought would be implementation-defined attributes.  In C, I've seen
> stuff like "__inline__" and "__attribute(something(params))".  It might be
> wise for the D spec to define something like "attribute(attr(params))" so
> that an embedded D compiler could use:
> attribute(section(.bootloader)) void initSerial() {}





More information about the Digitalmars-d mailing list