Opportunities for D

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 10 03:00:06 PDT 2014


On Sun, 2014-08-10 at 09:27 +0000, Bienlein via Digitalmars-d wrote:
[…]
> IMHO goroutines and channels is really the key. D might be a 
> better C++. But languages need a use case to make people change. 

From a marketing perspective, Go introduced goroutines (which is an
implementation of a minor variant of CSP more or less), Rust introduces
lots of things about memory management, references, etc. C and C++ have
none of these. What does D bring to the field that is new today so that
it can be used as a marketing tool?

[…]
> But Go also does not have these things. It's success is huge, 
> though, and it seems mostly to be attributed to goroutines and 
> channels. This made Go the "language for the cloud" (at least 
> other people say so), which is what there is a need for now. 
> Other than that Go is drop dead simple. You can start coding now 
> and start your cloud software start-up now. There is nothing 
> complicated you need to learn. D cannot compete with that (thank 
> goodness it is also no minimalistic language like Go).

The core point about Go is goroutines: it means you don't have to do all
this event loop programming and continuations stuff à la Node, Vert.x,
Vibe.d, you can use processes and channels and the scheduling is handled
at the OS level. No more shared memory stuff.

OK so all this event loop, asyncio stuff is hip and cool, but as soon as
you have to do something that is not zero time wrt event arrival, it all
gets messy and complicated. (Over simplification, but true especially in
GUI programming.)

Go is otherwise a trimmed down C and so trivial (which turns out to be a
good thing) but it also has types, instances and extension methods which
are new and shiny and cool (even though they are not new nor shiny).
These new things capture hearts and minds and create new active
communities.

It is true that Go is a "walled garden" approach to software, the whole
package and executable management system is introvert and excludes. But
it creates a space in which people can work without distraction. 

Dub has the potential to do for D what Go's package system and import
from DVCS repositories has done, and that is great. But it is no longer
new. D is just a "me too" language in that respect.

> >Akka similarly uses its own lightweight threads, not heavyweight 
> >JVM threads.
> 
> Akka uses some approach like Apple's Grand Central Dispatch. As I 
> understand it so does vibe.d (using libevent). A small number of 
> threads is serving queues to which tasks are added. This works 
> fine as long as those tasks are short runners. You can have 
> 50.000 long runners in Go. As long as they aren't all active the 
> system is well responsive. You can't have 50.000 long-runners in 
> Akka, because they would block all kernel threads that serve the 
> task queues. The 50.000 and first long running task will have to 
> wait a long time till it will be served. This is why they have 
> special worker threads in Vert.x for Java: threads that are 
> reserved for long-runners (and you can't have many of them).

And Erlang. And GPars. And std.parallelism. It is the obviously sensible
approach to management of multiple activities. D brings nothing new on
this front.

What no native code language (other than C++ in Anthony Williams'
Just::Thread Pro in vestigial form) has is dataflow. This is going to be
big in JVM-land fairly soon (wel actually it already is but no-one is
talking about it much because of commercial vested interests)

So if D got CSP, it would be me too but useful. If D got dataflow it
would be "D the first language to support dataflow in native code
systems". Now that could sell.



-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140810/67c9926c/attachment-0001.sig>


More information about the Digitalmars-d mailing list