Simon Peyton Jones: Data Parallel Haskell
nuACM5 HN recommenders · recommended in 5 months, 2010–2017
talk · advanced · 2010–2017 on HN
Simon Peyton Jones explains nested data parallelism and Data Parallel Haskell, an approach to exploiting multicore and distributed hardware while keeping a simple single-control-flow programming model.
Recommended as a fascinating look at easy parallelism abstractions, though other commenters note the approach never beat sequential C by much.
Up next
1 mo on HNCompiling and Optimizing Scripting Languages
Google TechTalks
1 HN recommend · 2011–2020
5 mo on HNP vs. NP and the Computational Complexity Zoo
hackerdashery
4 HN recommender · 2015–2026
1 mo on HNLucas Cavalcanti & Edward Wible - Exploring four hidden superpowers of Datomic
ClojureTV
1 HN recommend · 2015–2024
12 mo on HNReverse emulating the NES to give it SUPER POWERS!
suckerpinch
12 HN recommender · 2018–2025
4 mo on HNRustLatam 2019 - Without Boats: Zero-Cost Async IO
Rust Programming Language
5 HN recommender · 2019–2020
10 mo on HNConway's Game Of Life in APL
Dyalog
11 HN recommender · 2010–2024
2 mo on HN7 Habits For Effective Text Editing 2.0
Google
2 HN recommender · 2012–2023
3 mo on HNSnarky Puppy - Lingus (We Like It Here)
GroundUP Music NYC
3 HN recommender · 2016–2019
18 mo on HNRuby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich
Confreaks
17 HN recommender · 2013–2026
14 mo on HNThe Soul of Erlang and Elixir • Sasa Juric • GOTO 2019
GOTO Conferences
16 HN recommender · 2019–2024
14 mo on HN"Simple Made Easy" - Rich Hickey (2011)
Strange Loop Conference
14 HN recommender · 2022–2026
13 mo on HN"Making Impossible States Impossible" by Richard Feldman
elm-conf
9 HN recommender · 2017–2026
11 comments from Hacker News
Well nested data parallelism generally applies to hierarchical structures like trees, whereas flat data parallelism applies to things like arrays and whatnot. You might want to watch this (similar in some ways) talk by SPJ on Data Parallel Haskell ▶ this video
I believe Haskell compilers are pretty amenable to stuff like this - watching "Data Parallel Haskell", it was interesting to see how they actually map out contiguous memory, etc. ▶ this video Sadly, it doesn't seem to be as tightly integrated as what you'd see in SBCL from a developers PoV, but I'm certainly intrigued by their ability to achieve some very specific implementation while separating it from the expression of the algorithms.
This is both a straw man (OP asked for limited help, not omnipotence), and predicting the future by drawing a line from the past. Functional compilers that outperform hand tuned C++ on many core machines may be possible, but very hard. Just because everyone has previously underestimated the difficulty does not mean it's an idea worthy of derision. I think it's much more likely that it's perpetually ten years away, until one day it's not (like the current, possibly temporary end to Moore's Law). Watching Simon Peyton Jones' talk on data parallel Haskell, I'd not make a bet against high performance Haskell's eventual success, especially as core counts continue to climb, and NUMA gets more NU. ▶ this video
Here's the main Haskell hero, Simon Peyton Jones giving a talk about data parallel Haskell, which I think is a promising language abstraction to do hard things with parallelism relatively easily: ▶ this video As for techniques that can be used now: Haskell's `par` and `pseq` combinators allow adding parallelization to "hard" code after-the-fact pretty easily.
While this isn't undeniable proof, it's interesting none the less, Simon Peyton Jones: Data Parallel Haskell. ▶ this video He talks about how this scheme can parallelize non-trivial data structures, and how tedious book keeping can be avoided. I haven't used it yet in a project, so I can't speak of its efficacy - but worth a watch, imho.
One of my favorites of these is only showing the speedup..."scales linearly", without comparing to a non-parallel baseline. First time I saw this was with Clik, which reported linear scaling. I was impressed, until I found out that the parallel version was 6x slower on a single CPU than the sequential version. Similar with a SPJ talk on parallel Haskell (can't find it right now). Big claims about this being the One True Way, and then required four cores to match C sequential case. Hmmm. UPDATE: ▶ this video around the 1h 10min mark. Four cores to match sequential C (previously had written six, was wrong)
The "FP for multi-core" trope is a red-herring, at least so far. Yes, immutability makes parallelizing easier. It also makes things in general so much more expensive that we're still net-negative by a large margin. For example, Simon Peyton Jones gave a talk[1] about Data Parallel Haskell, which after many years of development was still slower on 6 cores than C on a single core. [1] ▶ this video
LOL! My 1st year university course was 1989. When were you born? Interestingly, that is exactly what I see in the current generation of FP hypsters. Grandiose claims based on very limited experience. Aka: know so little, assume so much. But don't worry, it happens to the best. My favorite is still the Simon Peyton-Jones talk on Data Parallel Haskell, where he can't help himself, but just has to make the snide comment "this is only possible in a language like Haskell". Hand raised in the auditorium: The HPC community has been doing this for years. In FORTRAN. But carry on... (And of course, the results are dismal: 6 cores required to match sequential C! Considering that this sort of concurrency [there are others] is exclusively for better performance, that is a damning result). Despite these, er, issues, it is an absolutely fascinating talk, and the techniques look quite worthwhile. After all, they've been in use in the HPC community for some time :-) ▶ this video
Your make some good points, but I don't quite buy them. Turbo Pascal for example was written by a single guy, Anders Hejlsberg, in about 2 years for several platforms in assembly language, and included an integrated (though primitive) text editor/IDE. Smalltalk was taken from ST-72 to ST-80 in 8 years, with small teams that also had to invent/implement complete VMs, operating systems, bitmap graphics engines, GUI framework(s) and sophisticated IDEs. You write that it would be nice to have an FP IDE so it could give you better feedback (or were you talking about an existing FP IDE). These guys built the live IDE (even better than types for direct feedback) in a fraction of the time. Does OPAL still compile to C? Does it still use Tk? Think about Ruby, Python, etc. I could go on (the VPRI stuff is also amazing), but I think you get the idea: it seems that not only can you be a productive member of society without FP, it sure looks like people can be a lot more productive without FP than with it. Java is not really a good example of anything. Certainly not of an OOPL: "Java is the most distressing thing to happen to computing since MS-DOS." "If the pros at Sun had had a chance to fix Java, the world would be a much more pleasant place. This is not secret knowledge. It’s just secret to this pop culture." — Alan Kay (who coined the term "object oriented") I don't quite get why you see LISP as an example for the power of FP, it is a multi-paradigm language with some functional elem
tl;dr: "we remark that all 3 languages provide easy-to-use, high-level and efficient support for parallelism. Haskell has an edge in its rich libraries and aggressive optimisation. Through laziness, top-level parallelism can be specified in a more modular way, minimising the need to modify components and avoiding any notion of explicit threads. Thus, Haskell is the language of choice for minimally intrusive parallelism. F# and Scala provide several mechanisms for parallelisation, some as high level as Haskell’s, some lower level with more potential for performance tuning. Thus, these languages provide a more direct route to controlling low level aspects and can use object-oriented and impure language features." It would be cool to see a similar contrast between Data Parallel Haskell ( link / ▶ this video ) and others.
Dude, you just DID NOT insult Haskell ! [Sort of relevant] Apparently SPJ was once asked by a customs official in America if an american citizen could do what he did. Someone with him announced that his work as the creator of ML made him irreplaceable. So you see, ML's got fanboys in high places. Even close to SPJ apparently. Source for SPJ Koan : ▶ this video (around the 4 min mark).