Back to 2015-proposals
Title: Understanding Transducers Through Python
Proposer: Robert Smallshire
Type: Tutorial with lots of lovely concepts and code
Duration: 90 mins
Description:
Transducers - a portmanteau of 'transform reducers' - are a new functional programming concept
introduced into the Clojure programming language. Although transducers are actually pretty
straightforward in retrospect, wrapping your brain around them, especially if you're not already a
competent Clojureist, can be challenging.
In this session, we introduce transducers by implementing them from scratch in everybody's favourite
executable pseudocode, Python. We'll start with the familiar staples of functional programming, map(),
filter() and reduce(), and derive transducers from first principles. We'll work towards a set of general
tools which work with eager collections, lazy 'pull' sequences, and 'push' event streams. Along the way
we'll cover stateful transducers and transducer composition, demonstrating that transducers are both
more general, and more fundamental, than the functional programming tools baked into Python and
many other languages.
By the end of this session, not only should transducers make sense to you, but you'll have a recipe for
implementing transducers in your own favourite programming language.