The Next Mainstream Programming Language: A Game Developer's Perspective :: Redux
Craig Black
craigblack2 at cox.net
Sat Jul 14 22:57:31 PDT 2007
I can see where you are coming from and appreciate your enthusiasm.
However, I can also see Sean Cavanaugh's point about threading capabilities
being overly complex. I can see that D is trying to address thread support
using libraries. There are many classes in Tango that work toward this
purpose. And they seem to be clean and capable, but IMO not a huge leap
forward when compared to how threading is done in other modern languages.
The problem with threading is complexity. For example, there are many
classes in Tango that accommodate concurrency: Thread, Atomic, Barrier,
Condition, Mutex, ReadWriteMutex, Semaphore. To someone like myself, who is
not exactly a concurrency expert, this can be quite overwhelming. How can
we make it simpler for programmers? Perhaps is can't be simplified any
further and the best we can do is documentation, tutorials, etc.
But I think there are ways to make it easier. I am a fan of the Concur
project. I think at least some of the abstractions that Sutter and friends
have identified can be implemented in D with libraries. Some may not be
implementable with libraries, but may require support in the compiler.
Whatever the case, I think D's compiler/standard libraries should be
extended to deliver the features that Sutter is promoting.
-Craig
"downs" <default_357-line at yahoo.de> wrote in message
news:f7aigu$1uif$1 at digitalmars.com...
>I basically agree with the GC issues.
>
> If it were up to me, I'd integrate a separate mode into the GC, in which
> it is only run in debug mode - and breaks on collection! Basically, I'd
> not use it as a collector per se, but as a tool to make manual memory
> cleaning easier.
>
> Apart from that, I agree D is not quite ready for a massively parallel
> future - but the strength of the language is such that it can be made to
> be ready, without requiring any in-depth changes.
> Take the following example.
>
> foreach (foo; parallel(bar)) { /* do stuff with foo */ }
>
> Looks neat? It can be made to work _today_, with D 1.0 or 2.0, GDC or DMD,
> without requiring _any changes to the compiler_, using exclusively
> language features (about one page of code) - and even without any
> significant runtime overhead! :D
> And there's a decent amount of multithreading extensions for D already.
> Take a look at StackThreads or DCSP on
> http://assertfalse.com/projects.shtml , all implemented using a minimum of
> machine specific code, and working fine (I think. I hope. :p )
>
> From my (admittedly overoptimistic and fanboyish) perspective, even
> without threading built into the language, D is quite prepared for a
> massively-multithreaded future. :)
>
> --downs
More information about the Digitalmars-d
mailing list