HackerTubewatch
Surprise me
Frame from Four Solutions to a Trivial Problem - Guy Steele Jr. Plays via YouTube's privacy-enhanced embed

Four Solutions to a Trivial Problem - Guy Steele Jr.

56 videos recommended on HN
YouTube
4 HN users recommended this talk4 months2017–2023 score 4.5
Years with an HN recommendation, 2007–2026

HN points to it as a clear lesson that algebraic properties like associativity unlock parallelism, applicable in any language.

Guy Steele presents a small geometric problem and compares four computational approaches: a classic sequential solution and three parallel-friendly ones. Each is illustrated pictorially and with working code, weighing total work against time to solution.

“watch Guy Steele's talks [1][2][3] if you are interested in data parallelism!” (HN, 2020)

1 strong recommendations · 3 recommendations · 3 citations · Talks · intermediate

7 Hacker News comments

From the HN archive; up to 20 kept per video, favoring different commenters. Recommendations first.

@tkf Oct 2020 Strongly recommends
on HN thread A quick introduction to data parallelism in Julia
Read more
Hi, the author here. One of the hidden messages of the introduction is: watch Guy Steele's talks [1][2][3] if you are interested in data parallelism! These talks are not Julia-specific and the idea is applicable and very useful in any languages. My libraries are heavily inspired by these talks. Of course, if you haven't used Julia yet, it'd be great if (data) parallelism gives you an excuse to try it out! It has a fantastic foundation for composable multi-threaded parallelism [4]. [1] How to Think about Parallel Programming: Not! [link] [2] Four Solutions to a Trivial Problem [this video] [3] Organizing Functional Code for Parallel Execution; or, foldl and foldr Considered Slightly Harmful [link] [4] Announcing composable multi-threaded parallelism in Julia [link]
Guy Steele's talks on data parallelism apply in any language
@platz Aug 2018 Recommends
on HN thread Organizing Functional Code for Parallel Execution (2009) [video]
I enjoyed this talk along the same lines by Guy Steele, regarding not necessarily forcing a sequential solution to a non-sequential problem: Four Solutions to a Trivial Problem - Guy Steele Jr.: [this video] Look for steps that are commutative and/or associative in the problem to exploit parallelism.
Avoid forcing sequential solutions; exploit commutative and associative steps for parallelism
@heleninboodler Sep 2022 Recommends
on HN thread Someone is pretending to be me
Read more
This type of interviewing style is bullshit. It means the interviewer knows a better solution that is "clever" and expects you to either have the same cleverness epiphany on the spot or to have studied this question. Neither is actually very useful as a hiring criterion. Guy Steele gave an incredibly interesting guest talk[1] at google about four different ways to solve this exact problem, and the fact that it's an interesting enough topic for an hour long google talk should probably be a clue that you shouldn't be expected to invent the best solution on the whiteboard in 40 minutes. [1] [this video]
Guy Steele's talk on four ways to solve one problem
@MathMonkeyMan Jul 2023 Recommends
on HN thread Coroutines for Go
Guy Steele Jr. worked on a language called "Fortress." There are a few good talks that he gives: - (toy problem) [this video] - (parallelism) [link] - (languages) [link]
Guy Steele Jr. toy-problem talk among his good talks

Citations, criticism and jokes

@EdwardCoffin Mar 2017 Cites it
on HN thread Abstract Algebra (2016) [pdf]
Read more
Guy Steele [1] sometimes mentions it. He gave an interesting Google Tech Talk called Four Solutions to a Trivial Problem [2], and at 1:59 [3] he said: Also, algebraic properties are important. I've got a background in applied algebra, and I think that has informed my programming. And I think that making programmers aware of algebraic properties of their code, and communicating some of those properties to the compiler, may be worthwhile. The language Fortress [4], which he was one of the language designers of, allowed one to explicitly provide the compiler with such information - you could say that a certain operation was distributive or associative for instance, and the compiler could then do some refactorings and optimizations taking this knowledge into account. [1] [link] . [2] [this video] [3] [this video] [4] [link]
Guy Steele on why algebraic properties of code matter for compilers
@platz Mar 2019 Cites it
on HN thread Why are monoidal categories interesting?
associativity is the key to parallelism Four Solutions to a Trivial Problem - Guy Steele Jr. [this video] (using a monoid-cached tree)
Illustrates associativity as the key to parallelism using a monoid-cached tree
@raphlinus Feb 2022 Cites it
on HN thread Mastering Dyalog APL (2009) [pdf]
Read more
I think APL has a lot to teach us about parallel (specifically GPU) programming. I've rewatched a few talks with Aaron Hsu and listened to his arraycast podcast[1]. In researching an upcoming blog post on monoids, I tried implementing the problem in Guy Steele's "Four Solutions to a Trivial Problem" talk[2] in APL (actually I tried GNU APL for this, because I didn't need anything fancy). This is what I came up with: +/((⌽⌈\⌽a)⌊⌈\a)-a That in turn should be fully parallelizable and run fast on the GPU, as it's based on a couple scan (generalized prefix sum) operations. There's a considerable amount of DNA from APL in modern compiler-based machine learning frameworks, mostly by way of numpy. Dr. Hsu makes a good case that APL has quite a bit of power which is considerably diluted in later spins such as numpy. I'm especially fond of the power (⍣) operator[3], which represents parallel iteration and I think can often be translated to a per-thread while or for loop in a compute shader. I don't believe numpy has anything quite like that (but feel free to correct me!). [1]: [link] [2]: [this video] [3]: [link]
Source of a problem the commenter implemented in APL with scans

Video list and Hacker News comment labels from HackerTube (prompted by @karpathy), released under ODC-By 1.0, built on the open-index/hacker-news archive. Hacker News data is provided by Y Combinator; comments remain the work of their authors. Video titles, channel names and thumbnails belong to their creators and are shown via YouTube. HackerTube Watch is an unofficial edition. Data export of 2026-10-31.

Keyboard shortcuts

/
Search
j k
Next / previous video
r
Surprise me
l
Like (video page)
w
Watch later (video page)
?
This help
Esc
Close