Build Functional Reactive - developermarch.com · Functional Reactive Programming (FRP) principles....
Transcript of Build Functional Reactive - developermarch.com · Functional Reactive Programming (FRP) principles....
Build Functional Reactive Applications with Elm, Node.js and Infinispan
Galder Zamarreño Arrizabalaga 25th April 2017
Moi
• @
• Infinispan developer & co-founder
•Polyglot programmer
•Functional programming
@galderz
#infinispan
Elm
HTTP
TCP/IP
statically compiled
building web user interfaces
promotes FRP
compiles to fast
Javascript
Elm
HTTP
TCP/IP
statically compiled
building web user interfaces
promotes FRP
compiles to fast
Javascript
most helpful compiler
Elm
HTTP
TCP/IP
statically compiled
building web user interfaces
promotes FRP
compiles to fast
Javascript
most helpful compiler
no runtime
exceptions
Node.js
HTTPTCP/IP
based on express.js
FRP friendly (async, events)
stateless, listens on port 3000
talks binary to data grid
infinispan
HTTPTCP/IP
in-memory data grid
open source
(ASL2)3 server node
domain
2 copies redundant
Java, Node.js, C/C++... clients
infinispan
HTTPTCP/IP
in-memory data grid
open source
(ASL2)3 server node
domain
2 copies redundant
Java, Node.js, C/C++... clients
remote event
listeners
Elm ArchitectureElm Runtime
Model
Html + Msg (Click) update
Msg (Click) + Model
Cmd e.g. http call…Msg (Http Resp) + Model
Model updated
Model
view
… button click …
demo: insert Talk (4)
POST /events
putIfAbsent
true/false
createdevent
JSON true/false
WS: JSON event
WS: JSON event
Elm limitations
• typeclasses → +boiler plate code •dictionary type
•Less FRPy version 0.17+ • Interacting with complex Javascript libraries
•Alternative: Purescript (+complex)
Learn How To Build Functional Reactive Apps
what is FRP
why FRP is useful
how to build an FR app
live coding an FR app
creditsApprove by Aha-Soft from the Noun Project
Window by Oleg Frolov
from the Noun Project
Server Error by Montu Yadav
from the Noun Project
Databases by Oliviu Stoian
from the Noun Project
demo link
github.com/galderz/infinispan-events/tree/early17
Thanks
•elm-lang.org
• infinispan.org
•redhat.com/en/technologies/jboss-middleware/data-grid