ERLANG, LFE, JOXA & ELIXIR
Established and
Emerging Languages in
the Erlang Ecosystem
Let’s talk about computers.
many processors
in a network
inside an even
bigger network
and none of it’s
reliable
and also it’s spread across the
globe
Our challenge as engineers is to hide the complicated details of all of this.
Let’s talk about Erlang.BEAM
Bogdan/jörn’s
Erlang
Abstract
Machine
Concurrent
Concurrent Soft Real-Time
Concurrent Soft Real-Time Throughput Optimized
Concurrent Soft Real-Time Throughput Optimized Embeddable
So we should all start using Erlang right away, yes?
Well…
Let’s talk about style.
Miles Davis
Miles Daviscool
Miles Daviscool spare
Miles Daviscool spare deliberate
Miles Daviscool spare deliberate flawless
Miles DavisSought to make an individual, new sound.
John Coltrane
John Coltrane
avant guard
John Coltrane
avant guard complex
John Coltrane
avant guard complex chaotic
John Coltrane
avant guard complex chaotic blemished
John Coltrane
Sought the transcendent
through music.
Thelonious Monk
Thelonious Monk
unorthodox
Thelonious Monk
unorthodox eccentric
Thelonious Monk
unorthodox eccentric
discordant
Thelonious Monk
unorthodox eccentric
discordant perfect
Thelonious Monk
Made music like a fish swims in water
I’m going to compare
programming languages.
These languages are not so dissimilar.
This is not a life or death
matter.
This is a matter of right tool, right job.
Every language has an intrinsic philosophy of “good software”.
The language designers’ choices influence what a language is most naturally useful for.
Sometimes a design goal is explicit.
Erlang
Soft real-time, concurrent and fault tolerant systems.
Subsystems may fail but the service as a whole remains online.
Failures cause sub-system restarts.
Restarts put the system back in a well-known state: prefer faults over error handling.
Let it crash!
Language features make crashes more likely.
Pattern Matching
No assignments:
Failed matches cause crashes.
Process Linking
Faults cascade up the process hierarchy.
Traps exist to survive child crashes but they are not on by default.
Strict process isolation.
State changes are effected only through message passing.
Processes are sequential internally, concurrent to one
another.
L F ELisp Flavored Erlang
Maintains semantic
equivalence to Erlang.
Lisp-2, Macros &
Homoiconicity
A REPL, not just a
shell.
Erlang, in Lisp
Clothing
Let it crash!
Joxa
Lisp-1, Macros &
Homoiconicity
A lisp that happens to run on
BEAM
Elixir
Solves the “Expression”
problem
Protocols
Streams / Iterables
Infix
Operators
Multiple function invocation styles
Metaprogramming
Multi-Assignments
Pattern Matching is non-default. Must use a prefix character to match.
Defaults callbacks for OTP
Behaviours
Which of these languages are production ready?
What’s your risk tolerance?
LFE 367 commits August 22, 2008 updated weekly 14 contributors
Joxa 470 commits November 25, 2011 updated monthly 8 contributors
Elixir 7618 commits January 9, 2011 updated daily 168 contributors
Erlang 14,273 commits Estd.1986 updated daily
227 contributors
Complexity
Complexity
Erlang
Complexity
Erlang LFE
Complexity
Erlang ElixirLFE
Software projects go through three stages: !
• exploration • stable development • maintenance
Experimentation
Stable Development
Maintenance
Different phases of the life-cycle express different needs.
Experimental: “Move fast, break stuff.”
Stable: “Go fast and mostly work.”
Maintenance: “Move slow, build things.”
“Expressivity”, which is a boon while prototyping, can be a curse in more stable environments.
“Intentional” languages may be too cumbersome in an environment of complete unknowns.
Complexity
C++Erlang ElixirLFE
C++Erlang ElixirLFE
None of the BEAM languages abandon what makes Erlang great (especially not Erlang).
Elixir targets the experimental, very beginnings of stable.
LFE targets the tail end of experimental, beginning to mid of stable.
Erlang is a stable and maintenance stage sort of language.
Experimentation
Stable Development
Maintenance
Elixir
LFE
Erlang
Questions? <3
Thank you! @bltroutwine