"Transducers" by Rich Hickey
Why Hacker News recommends it
HN treats it as the original and definitive explanation of transducers, recommended whenever the concept comes up.
What it is
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.
Recommended by 6 HN commenters across 6 different months, 2014 to 2025.
What Hacker News said
Strong rec jwr · 2025-11 · on “Transducer: Composition, abstraction, performance (2018)”
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: [this 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 more and more in your code. Many things our software does can be looked at as pipelines, and transducers let you write composable functions and put them together into pipelines. As you see more pipelines in your code, you will write those composable functions and reuse them in various places. Experience
Recommends rymohr · 2014-10 · on “Transducers for JavaScript”
That and they're collection agnostic. I highly recommend watching Rich Hickey's talk for more background: [this video]
Recommends ultimape · 2014-11 · on “Rich Hickey – Inside Transducers [video]”
Here's another video by Rick Hickey about transducers: [this video] - it was referenced in this great post detailing the transducer notion with Clojure, Scala, and Haskell: [LINK]
Recommends talkingtab · 2022-11 · on “Why would anyone need JavaScript generator functions?”
Transducers. See Richard Hickey's talk about transducers here: [this video] You can implement transducers in JavaScript using generators. It was somewhat mind bending but fun.
Recommends devin · 2023-09 · on “My mental model of Clojure transducers”
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: [this video]
Recommends ThatGeoGuy · 2024-08 · on “Reflecting on transducers in Scheme (2023)”
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 [LINK] 2. Transducers necessarily abstract across a lot more than loops / lists. Lisps do a lot of really cool (and optimized) stuff with lists alone and Scheme is no different in this regard. However, because of how Scheme primarily exports list operations in (scheme base) is really easy to run into a s
Cites asolove · 2014-10 · on “Talking about “types””
Rich brought this up in his Strange Loop talk [1]. All the attempts he had seen either disallowed perfectly valid uses or allowed invalid ones. I believe to really guarantee early termination and a few other tricky invariants of reducers you would need a linear type system. [2] [1] [this video] [2] [LINK]
Cites brandonbloom · 2014-10 · on “Type-safe Transducers in Clojure, Scala, and Haskell”
This is interesting, but it's still missing some very important features of transducers. As you alluded, stateful operations [1] won't work at all in your Haskell model. Also, you've missed early termination [2], which Rich's talk [3] covered well. [1] [LINK] [2] [LINK] [3] [this video]