Navigation

Reactive Programming in Perl 6

Reactive Programming in Perl 6

By Jonathan Worthington (‎jnthn‎)
Date: Friday, 25 April 2014 11:15
Duration: 40 minutes
Target audience: Intermediate
Language: English
Tags: 6 async reactive


We're all used to arrays. But what about when we don't want to produce all of the values at once, or there might be an infinite number of them? This is where we turn to iterators, or enumerators, or lazy lists, or generators - all of which boil down to the a single design pattern: the iterator pattern.

Iterators are great. We ask them for a value, and they go off and work on producing one for us. However, that also means that iterators are synchronous and blocking. They're less ideal when it comes to lists of things that are produced asynchronously: file system change notifications, user interaction, tweets, and so forth.

Enter reactive programming, a paradigm derived from the exciting category-theoretic realization that the iterator pattern and the observer pattern are dual!

"Huh?" "Category..dual...what?"

Thankfully, you don't need to learn category theory to put reactive programming to use. Here's the bottom line: all of the familiar list operators (map, grep, zip, concat, etc.) can be sanely defined on asynchronously produced streams of values too. This, happily, means you can use your existing knowledge of a bunch of language constructs in order to deal with asynchronous data.

Come along, and learn how to grep the future!


Attended by: Martin Berends (‎mberends‎), Theo van Hoesel (‎vanHoesel‎), Mallory van Achterberg (‎Stomme poes‎), mna, Oleg Komarov (‎komarov‎), Wendy Van Dijk (‎woolfy‎), Leon Timmermans (‎leont‎), Igor Sutton Lopes, Abe Timmerman (‎abeltje‎), Sebastian Stellingwerff (‎webmind‎), Søren Lund (‎slu‎),