HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

"Transducers" by Rich Hickey

Strange Loop Conference6 HN recommenders · recommended in 6 months, 2014-2025
YouTube
116K views · 12 years ago · talk · evergreen

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.

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

Functional programmingSoftware architecture & design#clojure#functionalprogramming#richhickey#composition#reducers

9 comments from Hacker News

@jwr2025 · in “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. Experienced Clojure programmers will rarely use loops, for me transducers are the #1 choice whenever I have to process a collection of any kind. Their efficiency (no intermediate collections!) is a nice bonus — you get both high-level composable code and efficiency, which is incredible. One thing I dislike about transducers is when I need a stateful one: these are hard to understand and very difficult to write. I rarely do this, except when I really want to stick to the transducer abstraction and I have a couple of hours to spend on a puzzle. But you rarely need to write your own stateful transducers, usually the built-in ones are enough (things like take/drop).

Strongly recommendsView on HN
@ThatGeoGuy2024 · in “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 situation where lists are used in an ad-hoc way where another data structure is more appropriate. This includes vectors, sets, mappings, hashmaps, etc. Transducers-the-library is meant to be general across operations that work on all of these types, so I chose language that intentionally departs from thinking in a list-focused way. Now, my main question. Transducer? I'm curious on the etymology of that word. By itself, I don't think I could ever guess what it was referencing. :( This is from Rich Hickey's presentation: ▶ this video It's not a reducer, because they serve as higher-order functions that operate on reducers. Instead, the values they accept are transient through the function(s), so they transduce. You should watch the video, I think Rich explains the origins of his language very well

RecommendsView on HN
@devin2023 · in “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

RecommendsView on HN
@talkingtab2022 · in “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.

RecommendsView on HN
@mgarus2021 · in “Has UML died without anyone noticing?”

This reminds me of a talk by Rich Hickey [0], where he introduces the Transducer pattern, which is actually an abstraction for map/reduce/fold/filter etc. (But I'm not trying to invalidate your claim that patterns exist in FP in general, only that specific case. Afaik, the Transducer abstraction isn't even widely-known nor used.) [0]: ▶ this video

CitesView on HN
@ultimape2014 · in “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

RecommendsView on HN
@brandonbloom2014 · in “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

CitesView on HN
@rymohr2014 · in “Transducers for JavaScript”

That and they're collection agnostic. I highly recommend watching Rich Hickey's talk for more background: ▶ this video

RecommendsView on HN
@asolove2014 · in “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

CitesView on HN
"Simple Made Easy" - Rich Hickey (2011)1:01:39

"Simple Made Easy" - Rich Hickey (2011)

ClojureTV
434K views • 5 years ago
"Simple Made Easy" - Rich Hickey (2011)1:01:39

"Simple Made Easy" - Rich Hickey (2011)

Strange Loop Conference
219K views • 5 years ago
The Language of the System - Rich Hickey1:02:50

The Language of the System - Rich Hickey

ClojureTV
174K views • 13 years ago
Clojure for Lisp Programmers Part 1 - Rich Hickey1:28:59

Clojure for Lisp Programmers Part 1 - Rich Hickey

ClojureTV
25K views • 13 years ago
Expert to Expert: Rich Hickey and Brian Beckman - Inside Clojure53:56

Expert to Expert: Rich Hickey and Brian Beckman - Inside Clojure

jasonofthel33t
119K views • 13 years ago
Rich Hickey rants about HttpServletRequest in 1080p: Death By Specificity from Clojure Made Simple4:57

Rich Hickey rants about HttpServletRequest in 1080p: Death By Specificity from Clojure Made Simple

Fred Overflow
43K views • 6 years ago
Effective Programs - 10 Years of Clojure - Rich Hickey1:14:52

Effective Programs - 10 Years of Clojure - Rich Hickey

ClojureTV
176K views • 9 years ago
Clojure Concurrency - Rich Hickey2:32:39

Clojure Concurrency - Rich Hickey

ClojureTV
73K views • 13 years ago
Clojure for Java Programmers Part 1 - Rich Hickey1:48:13

Clojure for Java Programmers Part 1 - Rich Hickey

ClojureTV
131K views • 13 years ago
Are We There Yet - Rich Hickey1:10:05

Are We There Yet - Rich Hickey

Zhang Jian
24K views • 7 years ago
Rich Hickey: Deconstructing the Database1:06:24

Rich Hickey: Deconstructing the Database

InfoQ
106K views • 14 years ago
Spec-ulation Keynote - Rich Hickey1:16:14

Spec-ulation Keynote - Rich Hickey

ClojureTV
135K views • 9 years ago
Maybe Not - Rich Hickey1:03:29

Maybe Not - Rich Hickey

ClojureTV
181K views • 7 years ago
The Functional Programmer's Toolkit - Scott Wlaschin1:05:51

The Functional Programmer's Toolkit - Scott Wlaschin

NDC Conferences
79K views • 7 years ago
"Type-Driven Program Synthesis" by Nadia Polikarpova39:40

"Type-Driven Program Synthesis" by Nadia Polikarpova

Strange Loop Conference
15K views • 8 years ago
Rails Conf 2012 Keynote: Simplicity Matters by Rich Hickey36:53

Rails Conf 2012 Keynote: Simplicity Matters by Rich Hickey

Confreaks
220K views • 14 years ago
Simplicity Ain't Easy - Stuart Halloway50:01

Simplicity Ain't Easy - Stuart Halloway

ClojureTV
24K views • 13 years ago
JSON Parser 100% From Scratch in Haskell (only 111 lines)1:50:07

JSON Parser 100% From Scratch in Haskell (only 111 lines)

Tsoding
205K views • 6 years ago
Lucas Cavalcanti & Edward Wible - Exploring four hidden superpowers of Datomic40:42

Lucas Cavalcanti & Edward Wible - Exploring four hidden superpowers of Datomic

ClojureTV
29K views • 11 years ago
Hammock Driven Development - Rich Hickey39:49

Hammock Driven Development - Rich Hickey

ClojureTV
333K views • 13 years ago