News for hackers. Stuff that matters.
Re:Ask HN: Multiprocessing & concurrency: C, Python, Clojure... by fauigerzigerk on Sunday October 24, 2010 @04:55AM (#1825676)
Both Clojure and Go have very interesting features to support parallel computing. Both are definately worth learning. Go's implementation is rather immature at this point in time. Some of the libraries and the garbage collector are really slow but things are changing rather quickly in Go land right now.

Go's design makes much more efficient use of a single machine's resources than any JVM based language ever could. In terms of memory it is comparable to C or C++. Goroutines are very lightweight because they use a variable size stack, so Go supports much more fine grained parallelism. Whether you need that or not depends on your application of course. I found goroutines much simpler and intuitively accessible than the large set of Clojure's parallel primitives. But I think reasonable people can have different opinions on that one as STM (software transactional memory) is attractive too and immutable data structures do make some things simpler.

Of course, Clojure is a Lisp dialect, which has other benefits that have nothing to do with parallelism. However, for many of my own tasks, memory usage is critical and Clojure hogs memory even more than regular Java, so that's why I would prefer Go once it matures a little. I think Go can replace C and C++ over time. Clojure will never do that in its current JVM based implementation.

In terms of raw performance, if memory is not the issue, you can expect similar results from Clojure and Go, provided you make use of static type hints in Clojure (which doesn't look pretty) and you give Go's creators some more time to optimize the stuff that's known to be slow.

There are no comments on this comment yet.