www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: synchronized vs. C volatile

SK Wrote:
 
 asm() hacks to fake volatile are too embarrassing to consider in a
 promising new systems language!

I'm not sure I agree. Unlike C/C++, inline asm in D is a clearly defined language feature. Also, making 'volatile' an attribute adds a lot of syntactic clutter for what really is a niche feature. That 'volatile' is almost universally misused in C/C++ supports the assertion that this perhaps should not be so obvious a language feature in D, particularly since it can be accomplished in-language via other means. That D only defines inline asm for x86 shouldn't much matter. It's clear that the D approach is to make inline asm look as much like native asm as possible, so how it will work on other platforms is easy to extrapolate. Until support is added for your platform of choice, just call out to external asm code.
Aug 10 2010