DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

Artur Skawina via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 15 10:03:52 PDT 2014


On 07/15/14 18:25, Johannes Pfau via Digitalmars-d wrote:
>   here again: We need _first-class_ support for embedded programming in
>   D. Workarounds might be available (peek/poke, inline asm) but it will
>   be obvious to most C programmers that C has got the better solution
>   with the volatile qualifier. D enthusiasts might be happy if they can

Compiler barriers are not "workarounds". "volatile" is not a "better
solution". It's used in C only because it's defined and reasonably
portable; barriers are a language extension, hence dialect specific.

First class support for "embedded programming" would be defining
barriers, not transplanting C's volatile. You can already express
all the described volatile semantics in GDC's D dialect, in a
completely portable way and without using a single asm instruction.
What's missing is just a defined standard interface which can be
supported by all D compilers.

artur


More information about the Digitalmars-d mailing list