Why I (Still) Won't Use D
Tim Burrell
tim at timburrell.net
Fri Mar 28 13:25:24 PDT 2008
Sean Kelly wrote:
> Hogwash. C++ has no in-language support for multithreading at all. OpenMP
> is simply a library built on top of C++. It doesn't count. One could create the
> exact same thing for D. Heck, D already has futures, DSCP, a good collection
> of synchronization primitives (tango.core.sync), etc.
Since you're allowing Tango library features you might as well allow
Boost to be included with C++. Even if you don't, really what I'm
intending to compare is a typical usage scenario for parallel
programming in D and C++.
With C++ you've got scoped mutexes and every multithreading thing you'd
need (all cross platform) via Boost... PLUS you've got OpenMP support
which is NOT just a simple library built on top of C++.
OpenMP does include a library API, yes, but mostly it's compiler
directives... this allows the compiler to optimize certain types of
operations based on static analysis, architecture features, etc...
something that'll be much harder to do via a simple library
implementation. This type of stuff really needs to be in the compiler,
and that's precisely where it is with OpenMP. Unless D adopts a similar
strategy it will never be able to compete.
At any rate, I didn't want this to be a C++ is better than D flame war
kind of thing, I just wanted to point out that unless D gets some really
good parallel support (and soon!) it's not going to continue to be as
interesting as it currently is!
>> When C++0x comes out, combined with OpenMP, D won't even be close to
>> being a viable language for parallel development... unless of course gdc
>> can leverage some of gcc's (>= 4.2) OpenMP support maybe?
>
> I disagree. D already has basically everything C++ 0x will have in terms of
> multithreaded support and it has them now. The only advantage C++ will
> have is a well-defined multithreaded memory model, and by the time anyone
> actually supports it for C++ 0x I suspect we'll have something equivalent in
> D.
OpenMP, OpenMP, OpenMP. D won't have OpenMP (or something like it).
That's what I want to hit home. Yes you're absolutely correct that D
already has everything C++0x will have in terms of native
multithreading, and while those things are a necessity they aren't
getting us any closer to a good model for parallel programming.
OpenMP isn't the be-all / end-all, there's tons of other interesting
stuff out there (join-calculus comes to mind), but it's a good start,
and without something like it (in terms of compiler support) D isn't
even a contender when it comes to parallel development.
More information about the Digitalmars-d
mailing list