System programming in D (Was: The God Language)

Vladimir Panteleev vladimir at thecybershadow.net
Fri Dec 30 04:00:06 PST 2011


On Friday, 30 December 2011 at 09:13:05 UTC, Walter Bright wrote:
> Also, if you are tweaking at such a level, every compiler is 
> different enough that your tweaks are likely to be 
> counterproductive on another compiler. Having a portable syntax 
> for such tweaking is not going to help.

Which is exactly why I think an inlining pragma/attribute should 
provide a guarantee, and not a hint. It's a web of 
assumptions/guarantees: asm blocks provide their guarantees, but 
using them introduces new assumptions, that e.g. force-inlining 
solidifies, etc.

Back to the macros vs.

> And if one really wants to force an inline, one can do things 
> like the C memcpy using the preprocessor, or string mixins in 
> D, or even cut&paste.

D has nothing from the above that's elegant and maintainable. 
Timon's solution comes close, but it uses a DSL to make up for 
what the language doesn't provide.

> If you need to do that in more than a couple places in the 
> code, something else is wrong (that old saw about only a tiny 
> percentage of the code being a bottleneck is true).

What about the context of creating an optimized library, as 
opposed to optimizing one application?


More information about the Digitalmars-d mailing list