5 ms·
Multicore Programming in Haskell Now
- davidw 17y agoI'll ask: with Erlang I understand the mechanism it uses for concurrency fairly well. From a quick glance at these slides, I get the impression that Haskell would be very good at doing parallel calculations (it's fast), but am not quite so certain about doing parallel system tasks, like sockets, something I know Erlang is good at. Care to elaborate? Do you guys have a fast/small web server, for instance? Something like mochiweb?
- dons 17y agoThere's quite a few on Hackage. http://hackage.haskell.org/packages/archive/pkg-list.html#cat:network http://hackage.haskell.org/packages/archive/pkg-list.html#ca... E.g. salvia: http://hackage.haskell.org/package/salvia http://hackage.haskell.org/package/salvia The trick is to use lots of Haskell lightweight threads to hide latency (much as you would with Erlang).
- davidw 17y agoCool, thank you! If I may ask you another question, how would one install that and start fooling around with it? I really don't have time, but... my curiosity has been piqued! (So much for 'discipline', but hey, it's a Sunday). (BTW, Google is very fast at indexing conversations here - this thread is the first thing that turns up for "mochiweb vs salvia")
- a-priori 17y agoCabal has a command-line tool for downloading and installing packages (http://hackage.haskell.org/trac/hackage/wiki/CabalInstall http://hackage.haskell.org/trac/hackage/wiki/CabalInstall). A package for it should exist for it on your platform, maybe called "cabal-install". Once you've got it, running "sudo cabal install salvia" should do the trick. (Failing that, you can wade through dependency hell and install salvia, and its dependencies, yourself. All Cabal packages have a Setup.hs or Setup.lhs file that controls building it. Run "runhaskell Setup.hs build" then "runhaskell Setup.hs install" (or similar) in each source tree.)
- dons 17y agoSuper easy: * one click: install the Haskell Platform: http://hackage.haskell.org/platform http://hackage.haskell.org/platform * type: cabal install salvia Another good one is hyena, http://hackage.haskell.org/package/hyena http://hackage.haskell.org/package/hyena You can get a concurrent web server going in a dozen lines of code or so.
- hairyarse 17y agoAlso, can anyone point me in the direction of how to do Erlang style distributed messaging? Is there a standard solution for inter-machine RPC in Haskell implementations?
- gaius 17y agoLots of great stuff happening in the Haskell community at the moment. What is it they're doing that the OCaml crowd aren't? This is a genuine question, I want to know so we can do it too...
- silentbicycle 17y agoThe OCaml community doesn't have anybody who promotes the language with quite as much gusto as dons, to my knowledge, and its library situation is a bit messy - there are nonstandard community replacements for the standard library[1] because Inria is just not going to fix some major warts. It has libraries[2] (and a pretty good library manager[3]), but OCaml has been around for quite a while and hasn't ever seemed to aquire critical mass. That degree of blatant fragmentation probably makes people wary. Haskell seems to be stealing its thunder now. There are numerous "intro to Haskell" / monad tutorial / etc. articles out there, and the OCaml community seems very quiet, by comparison. I don't particularly care for Haskell* , but its designers and users have done a good job of ensuring people hear about it, and get at least a roughly accurate first impression of what makes it noteworthy. * I don't like laziness as a default, I've been burned a couple times by portability issues (and the way that "whatever GHC does right now" has become a de-facto standard means that portability issues are probably not a priority), and it's academia-centric "avoid success at all costs" attitude doesn't sit right with me. [1]: http://code.google.com/p/ocaml-extlib/ [2]: http://godi.camlcity.org/godi/toc/toc-3.10.html [3]: http://projects.camlcity.org/projects/findlib.html/
- gaius 17y agoThere's also Jane Street Core http://ocaml.janestcapital.com/?q=node/13 http://ocaml.janestcapital.com/?q=node/13 What's also weird is that OCaml doesn't even have a big following in France, the French are well-known for championing their own ideas in the face of whatever Les Rosbifs are doing.
- silentbicycle 17y agoI get the impression that it may have been more popular several years ago - OCaml, Caml Light, and predecessors have been around for a rather long time, and have been used in education. It has a long, parallel history to SML. I'm not sure about the above because I can't read French, but I remember reading it somewhere relatively 'official'. (Perhaps in the translated O'Reilly book?) Either way, having half the stuff written about your language only available in French is probably not a strong life sign.
- amix 17y agoIt looks like the speed gains are rather small and optimizations complex to debug even for small programs. And the "implicit parallelism" is really an explicit one since you have to annotate/hint what could be run in parallel.
- dons 17y ago> speed gains are rather small How did you get that impression? Depending on the problem, there are programs in that talk that scale linearly with the available cores. Secondly, there are two forms of implicit parallelism presented: * "semi implicit parallelism", via annotations. no locks, synchronization or communication required * "data parallelism", a subset of the language that can be auto-parallelized. Or did I misunderstand you?
- amix 17y agoSlide 34 where you find out that the improvement was only a little better. 03.hs is a fairly simple program and I would guess that one would run into a lot of these problems developing "real programs". I would prefer if the compiler / runtime system were smart enough to figure out where parallelism could be applied - - and I would had guessed that this would be a lot easier in Haskell since there are no side effects. Are there anyone playing with the idea of JIT parallelism (i.e. apply parallelism while the program is running)?