Learning Haskell makes you a better programmer?

Russel Winder russel at winder.org.uk
Fri Dec 28 04:59:19 PST 2012


On Fri, 2012-12-28 at 09:37 +0100, evilrat wrote:
[…]
> well one of the points of immutable data is safely sharing across 
> threads(the point there is that data once allocated doesn't 
> changes so no need to sync it), functional languages also claims 
> that they provides easy concurrency(if not "automagically"), but 
> i can't say how it's really "easy" since i mostly do imperative 
> and object programming.

Functional programming languages providing parallelism "for free" is a
deep issue. Given the computational model of graph reduction, the whole
concept of parallelism is different from that of JVM-based and native
languages. OCaml has a GIL and so cannot handle single process
multi-threaded parallelism. Haskell has real problems with parallelism
because it is lazy: without manually structuring the sparks, you get all
the computation on the master thread no mater what.  Simon Peyton Jones
and Simon Marlow have created "Data Parallel Haskell" which makes data
parallel computations in Haskell very parallel and very fast. Actor,
dataflow, CSP, fork-join style parallelism is difficult in pure
functional languages. Clojure has made best inroads on this by employing
the features of the JVM in a Lisp context.
  
-- 
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: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121228/9f03b42a/attachment.pgp>


More information about the Digitalmars-d mailing list