[Haskell-cafe] Automatic parallelism in Haskell, similar to "make -j4"?

T Willingham t.r.willingham at gmail.com
Sun Nov 2 18:28:08 EST 2008

I was surprised when I read the multi-core section of Real World
Haskell which explains the use of par, seq, and force to achieve

While it's obvious a programmer could provide useful parallelism hints
to the compiler, given the nature of the language I would have thought
Haskell could do a significant amount of parallelism itself without
any hints or code changes at all.

I am thinking of our troglodytic friend 'make', which will run (for
example) 4 parallel jobs when given the option "make -j4".  Even
'rake', the ruby version of make, now has a branch (called drake)
which does the parallel -j option.

Since much of Haskell code is free of side effects, it would seem that
it can be analyzed in similar manner to Makefile dependencies in order
to find sections which can be run in parallel.

What would it take to implement a -j equivalent for, say, GHC?  Or if
this is not possible, what is wrong with my reasoning?


More information about the Haskell-Cafe mailing list