My personal reasoning about building the modern Web app frontend. Featuring functional reactive programming (FRP) and Elm.
July 3, 2015
–Richard Feldman at MLOC.js 2015
FAMILIARITY GROWS OVER TIME
...but complexity is forever
• Things to know by heart - language, framework
• Things to remember - project
• Things to handle when _______
• Less cognitive load
• Less things to go wrong
• Code style
• Modularity, separation of concerns
• Code reviews
• Quick hacks
–Brendan Eich at O'Reilly Fluent 2014
you have in place of a hand
–Chris Wilson, http://bendyworks.com/
Mutability is a kind of Chekhov’s gun,
it will go off by the third act
simply because it is there.
WHAT WE DO
• Forbid language features - ESLint etc.
• Agree on code style - JSCS etc.
• Add functional and reactive abstractions - lodash, RxJS…
• Switch out the language - Coffee, Clojure, JSX…
• Add static types - AtScript, TypeScript, Flow…
• Add immutable structures - Immutable.js, mori…
→ Transpile to ES5
• Use immutable structures and global state
• Describe what to do in pure functions
• Subscribe to streams of input
• Handle input safely
VISIONS OF THE FUTURE
–Jeremy Ashkenas, “Rise of the Transpilers”
“Someone is going to unify these three
different syntaxes and write a language
that just addresses the web-platform directly
and it’s going to be insanely popular”
• Static Types & Records
• Reactive - Signals
• Minimal syntax
• Compiles to ES5
–Richard Feldman at MLOC.js
I keep having this experience where I make a major
breaking refactor, recompile, ﬁx all the compiler
errors...and when I bring up Dreamwriter, everything
still works! No regressions!
This experience makes refactoring SO much fun!
Richard Feldman - Shipping a Production Web App in Elm
Chris Wilson - Elm for the Frontend, Right Now
elm-lang.org - /examples
Ignore the popularity
of a solution.
Stay close to the Science.