Philip Roberts

Enemy of the state: An introduction to Functional Reactive Programming and Bacon.js

@philip_roberts

Philip Roberts: Enemy of the state: An introduction to Functional Reactive Programming and Bacon.js from Neo (UK) on Vimeo.

Bio

I am the CTO and co-founder of Float, a web-app that helps small business owners understand, monitor and forecast their cash-flow.

I spend most of my work days wrestling with Backbone and Rails, and my spare time hacking on ridiculous side projects, throwing myself off diving boards, or trying to learn to play the piano.

Talk

State is hell when working with asynchronous code. Trying to deal with realtime data and user interaction with callback after callback after callback quickly leads to madness. Any callback, called at any time, can modify application state making code complex and hard to reason about.

Functional reactive programming is a powerful concept borrowed from Haskell that makes dealing with asynchonous code much easier (and fun!) to work with. Callbacks are replaced with event streams which can be mapped, merged, filtered and more, without having to manually maintain state! Bacon.js (https://github.com/raimohanska/bacon.js) by Juha Paananen is a lovely little library that implements FRP in JavaScript.

I'll introduce both FRP and Bacon - and with visualisations and examples show just how tasty Bacon is for working with asynchronous code.