core.cpuid

Jonathan M Davis jmdavisProg at gmx.com
Fri Nov 4 10:56:09 PDT 2011


On Friday, November 04, 2011 10:39 Dejan Lekic wrote:
> Jonathan M Davis wrote:
> > And why not? Thread is in core. So are other modules that it's perfectly
> 
> - Mostly because You may end-up writing non-portable code unless you are
> realy careful (and you must be if you use core modules! ;). It is similar
> to the asm{} block - you should not use it at all unless you know what you
> are doing... Does that make sense?

Plenty of core is portable. True, very little in Phobos is non-portable, so 
there's less risk of portability issues with Phobos, but much of druntime is 
quite portable - Thread being one such example. It's primarily the C 
declarations which aren't necessarily portable. Most of the D code is.

Now, it _is_ ultimately to the programmer to be smart about what they're 
doing, and more stuff in druntime is non-portable than in Phobos, but it's 
generally pretty clear about what's portable and what isn't. I really don't 
think that there's any need to tell people to stay away from core. If 
anything, they'll stay often away from it simply because much of its 
functionality is not directly necessary (if necessary at all) in your average 
program. But if you need it, there's nothing wrong with using it, and on the 
whole, portability isn't a huge issue.

- Jonathan M Davis


More information about the Digitalmars-d mailing list