"Transducers" by Rich Hickey

Channel:Strange Loop Conference · Length:45:00 · Published:2014-09-19 · Views:115756

Watch on YouTube

Summary

Rich Hickey introduces transducers in Clojure, a way to make map, filter and similar algorithms composable independent of the data source. This avoids duplicated implementations and intermediate collections across sequences, channels and streams.

Why HN recommends it

HN treats it as the original and definitive explanation of transducers, recommended whenever the concept comes up.

If you want a really good intro, watch Rich Hickey's talk about transducers — HN, 2025

Functional programming · Software architecture & design

Subtitles (excerpt)

transducers of course everything is just some combination of the same ingredients and the shell is on the outside it's on inside the cheese is in it's on top whatever um I'm not claiming any novelty here this is just another rearrangement of the same old stuff as usual um but you know sometimes the cheese on top you know tastes better than when it's inside all right so what are transducers the basic idea is to go and look again at map and filter and see if there's some idea inside of them that could be made more reusable than map and filter because we see map and filter being implemented over and over again in different contexts right we have map and filter on collections we have map and filter on streams we have map and filter on observables we were starting to WR write map and filter and and so on on uh channels and there was just there's no sharing here there's no ability to create reusable things so we want to take the essence out and see if we can reuse them uh and the way that we're going to do that is by recasting them as process Transformations and I I'll talk a lot more about that but that's essentially the entire idea recasting the the core logic of these what were sequence processing

On Hacker News

Transducers are IMHO one of the most under-appreciated features of Clojure. If you want a really good intro, watch Rich Hickey's talk about transducers: [VIDEO] (Rich is an excellent speaker and most of his talks are really worth watching, even if you don't use Clojure). The thing about transducers is that once you start using them, the abstractions click in your mind and you start using them mor… — jwr, 2025-11
Quick nit/question. For the fold method, I don't think I've seen it called sentinel value. Usually it is seed or initial? I think in Scheme it is common to call it knil, mirroring how lists use nil as the "sentinel" value which marks the end of a proper list. I opted to name it sentinel in that article (and in the docs) for two reasons: 1. Sentinel values are a common topic in many languages [LIN… — ThatGeoGuy, 2024-08
Rich gave a talk on this, and there is an associated HN thread for the talk, but some of you may be interested in the original transducers presentation. You can view it here: [VIDEO] — devin, 2023-09
Transducers. See Richard Hickey's talk about transducers here: [VIDEO] You can implement transducers in JavaScript using generators. It was somewhat mind bending but fun. — talkingtab, 2022-11
Here's another video by Rick Hickey about transducers: [VIDEO] - it was referenced in this great post detailing the transducer notion with Clojure, Scala, and Haskell: [LINK] — ultimape, 2014-11

Related videos