Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Return of Stream I/O

The Return of Stream I/O

The Frontend community is remarkably shifting towards functional programming, with tools like React, Redux, Immutable.js and Elm becoming mainstream. In the early years of Haskell, there were three I/O models: Monads, Continuations, and Streams. While the Monadic I/O has been established as the standard in Haskell, we are seeing the resurgence of variations of Stream I/O in Frontend, through tools like Cycle.js and Elm. In this talk we will explore the benefits and downsides of Stream I/O, and what it promises for the future.

André Staltz

October 04, 2016
Tweet

More Decks by André Staltz

Other Decks in Programming

Transcript

  1. "A transformational system repeatedly waits for all its inputs to

    arrive, carries out some processing, and outputs the results when the processing is done." (1998)
  2. "A reactive system continuously interacts with its environment, using inputs

    and outputs that are either continuous in time or discrete. The inputs and outputs are often asynchronous, meaning that they may arrive or change values unpredictably at any point in time."
  3. 1990 Pascal FORTRAN BASIC C Reactive programs Transformational programs 2000

    2010 Java JavaScript Monadic I/O good for 
 transformational programs
  4. 1990 Pascal FORTRAN BASIC C Reactive programs Transformational programs 2000

    2010 Java JavaScript Asynchronous Continuous interaction
  5. 1990 Pascal FORTRAN BASIC C Reactive programs Transformational programs 2000

    2010 Java JavaScript Asynchronous Continuous interaction
  6. 1990 Pascal FORTRAN BASIC C Reactive programs Transformational programs 2000

    2010 Java JavaScript Message passing
 concurrency
  7. Stream of DOM events Stream of actions Stream of state

    Stream of reducers Stream of markup to the DOM
  8. Asynchronous message passing User interfaces or any reactive system Separation

    of concerns
 Handling question-and-answer I/O Cycle.js
  9. Elm

  10. Elm program Elm runtime Task Result "Do this and then

    
 that and tell me the
 result"
  11. 1990 Pascal FORTRAN BASIC Java JavaScript Ruby C# C Reactive

    programs Transformational programs 2000 2010
  12. 1990 Pascal FORTRAN BASIC Java JavaScript Ruby C# C Reactive

    programs Transformational programs 2000 2010
  13. 1990 Pascal FORTRAN BASIC Java JavaScript Ruby C# C Reactive

    programs Transformational programs 2000 2010 Elm Elixir Clojure Dart
  14. 1990 Pascal FORTRAN BASIC Java JavaScript Ruby C# C Reactive

    programs Transformational programs 2000 2010 Elm Elixir Clojure Dart Asynchronous Message passing Event-driven
  15. Framework Concurrency Cycle.js Message passing React / Redux Message passing

    Elm Message passing Vue.js (Vuex) Message passing Angular v1 ($scope) Shared-memory ngrx Message passing
  16. Framework Paradigm Cycle.js Wannabe functional React / Redux Wannabe functional

    Elm Functional Vue.js (Vuex) OOP Angular v1 ($scope) OOP ngrx Wannabe functional