Your SlideShare is downloading. ×
Reactive meetup 0 copy
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Reactive meetup 0 copy

120
views

Published on

Reactive Programming Enthusiasts Denver Meetup kickoff session presentation

Reactive Programming Enthusiasts Denver Meetup kickoff session presentation

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
120
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Reactive Programming Enthusiasts Denver Meetup Kickoff - “What is Reactive?” Patrick Charles
  • 2. Patrick Charles reactive@ultrametrics.net https://github.com/pchuck
  • 3. Summary • What/Why Reactive? • Key Features • Functional Languages • Scala - actors, concurrency, message passing • Code
  • 4. What is Reactive? "The world is concurrent. Things in the world don’t share data. Things communicate with messages. Things fail." - Joe Armstrong (Erlang co-creator)
  • 5. Why Reactive? • Complexity and Scale • single/multicore -> thousands of nodes • single/multiple users -> millions • Kbps -> Gbps • seconds -> nanoseconds
  • 6. Key Features of Reactive • 0: Asynchronous - nonblocking and event-driven • 1: Loosely coupled - message passing w/o shared state
  • 7. Reactive Manifesto • “Event-Driven” - asynchronous, communication with message passing • “Scalable” - loose coupling, event-driven, location transparency • “Resilient” - able to recover from failures: isolation and supervision • “Responsive” - responds in a meaningful and timely fashion
  • 8. What happened? • Imperative Programming • Thinly veiled abstractions of the underlying and pervasive computing architecture • Shared state and serial execution of instructions • Thank, and blame, Alan Turing (1936) and Jon Von Neumann (1945)
  • 9. Functional vs. Imperative • Imperative • • • focus on steps or instructions and associated states computation is statements that change state Functional • focus on composition and arrangement of functions • computation is mathematical functions • avoids state and mutable data
  • 10. Lambda Calculus • Emphasis on functions or “software” independent of the underlying hardware • Variable binding and substitution • Computation by substitution and reduction • Anonymous functions == lambda expressions
  • 11. Common Features of Functional Languages • Immutability • Message Passing • Actors and Concurrency • Composition
  • 12. Reactive Constructs in Scala • “Event-Driven” - case classes, pattern matching • “Scalable” - actors, promises, futures • “Resilience” - futures (may never return or might return success/failure primitives), options (case object for non-existent values), supervisors (via Akka)
  • 13. Fractals • simple definitions • infinitely complex • detailed at arbitrary scales • self-similar
  • 14. Case Classes • Definitions of data-holding objects • Immutable and dependent on constructor args • Decomposed using pattern matching !
  • 15. Actors • Encapsulated units of consistency • Operate asynchronously • Communicate by message passing • scala - Reactor Trait: act() react {
  • 16. Traits • Interfaces • Class definitions with method signatures • Allow partial implementation ! ! !
  • 17. Code
  • 18. Resources • http://zeroturnaround.com/rebellabs/what-islambda-calculus-and-why-should-you-care/ • http://www.scala-lang.org/old/node/242 • http://www.reactivemanifesto.org/ • https://github.com/pchuck/fractactor • Coursera: Principles of Scala and Reactive Programming in Scala
  • 19. Summary • Software is used to model and solve real-world problems • The world is infinitely complex and unpredictable • Functional or imperative? • “Reactive” can mean many things • • Methodology • • Programming Style Application Architecture General goal is to reduce side-effects, scale, deal rationally with nondeterminism and failures
  • 20. Definitions • Lambda Expressions: ~anonymous functions • Currying: transformation/simplification of complex functions: f(x, y) = y/x -> f(2, y) = y/2 • Closures: separation of environment and control in evaluation of functions. A Lambda Expression with free variables that are closed or bound. • Partial Function: f: X ↛ Y computed for X’, over f: X' → Y, where X’ is a subset of X
  • 21. Segue • Concepts and Theory • Scala, w/o Akka, all computation, theory • Real-world Application - Mark
  • 22. Reactive Future (talks) • Reactive NoSQL - ReactiveMongo, MongoDB clusters and replicasets • Data Visualization - Reactive rendering of complex and dynamic datasets with Scala and D3 • Horizontal Scale - Reactive load balancing and fault tolerance with Amazon AWS and Elastic Load Balancing • Reactive tools and techniques in imperative languages: Java or C# • Reactive programming in other functional languages: Erlang, Haskell, Clojure, F#, Lisp • Interest areas, suggestions?