Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Haskell's tools mostly have the same sort of power as forkjoin (scheduling work to be done on separate threads; creating the right number of threads based on the hardware; providing an easy-to-use set of functions that call for work to be done in parallel).

The major difference is that the tools compose with the language better. Instead of having to keep "I'm working in a multicore environment" in your head all the time when you're writing your client code (as you would in Java, worrying about concurrent mutation and so on), Haskell enforces immutability throughout the language. Often you get the extremely convenient situation where you observe that something could be parallelized, change map to pmap and you're now using all your cores.



Yes. But immutability is not the whole job. You have to make sure to use the right data structures. Linear data structures like lists don't parallelize well. You need to use something that breaks into more equal parts instead of car and cdr.

Compare Guy Steele's talk "Get rid of Cons" at the International Conference on Functional Programming 2009. For the slides go to http://news.ycombinator.com/item?id=814632, the video should also be available online somewhere.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: