H1 2015 Priorities and Bare-Metal Programming

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 1 13:45:24 PST 2015


On 2/1/2015 3:22 AM, Johannes Pfau wrote:
> Am Sun, 01 Feb 2015 02:11:42 -0800
> schrieb Walter Bright <newshound2 at digitalmars.com>:
>> core.bitop.volatileLoad() and volatileStore() are implemented, and do
>> the job. They are compiler intrinsics that result in single
>> instructions. They support 8, 16, 32 and 64 bit loads and stores.
>
> I think everybody agreed that these low-level primitives can't be used
> in end-user code.

I apparently missed that discussion. (In any case, dealing with memory mapped 
I/O is not a usual programming task, I expect a programmer doing it will be more 
sophisticated.)

> We can generate nice wrappers (nicer than C code),
> which perform as well as C code, but only with force-inline _and_
> enabled optimizations (we essentially need heavy constant folding).

The compiler intrinsics participate in all optimizations.


> We also need a pragma(address) to complement pragma(mangle).

What would that do?


> * Using only part of druntime is ugly. The one thing most people would
>    probably like to strip out is the GC, but keep exception handling,
>    threads, ... But the GC is everywhere: core.demangle doesn't work
>    without, backtraces, exceptions, threads. Right now you either use
>    all of druntime or nothing but it's not possible to use parts of
>    druntime only, it's not modular enough.

De-Modularity is one of those things that one has to continually fight, like 
mildew in the shower. Turn your back on it for a moment, and interdependence 
creeps back in.



More information about the Digitalmars-d mailing list