erlang, lfe, joxa and elixir: established and emerging languages in the erlang ecosystem

104
ERLANG, LFE, JOXA & ELIXIR Established and Emerging Languages in the Erlang Ecosystem

Upload: brian-troutwine

Post on 10-May-2015

2.848 views

Category:

Technology


1 download

DESCRIPTION

This is a talk comparing the language philosophies of Erlang, LFE, Joxa and Elixir: the languages which target the erlang virtual machine (BEAM).

TRANSCRIPT

Page 1: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

ERLANG, LFE, JOXA & ELIXIR

Established and

Emerging Languages in

the Erlang Ecosystem

Page 2: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Let’s talk about computers.

Page 3: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

many processors

Page 4: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

in a network

Page 5: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

inside an even

bigger network

Page 6: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

and none of it’s

reliable

Page 7: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

and also it’s spread across the

globe

Page 8: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Our challenge as engineers is to hide the complicated details of all of this.

Page 9: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Let’s talk about Erlang.BEAM

Page 10: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Bogdan/jörn’s

Erlang

Abstract

Machine

Page 11: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Concurrent

Page 12: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Concurrent Soft Real-Time

Page 13: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Concurrent Soft Real-Time Throughput Optimized

Page 14: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Concurrent Soft Real-Time Throughput Optimized Embeddable

Page 15: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

So we should all start using Erlang right away, yes?

Page 16: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Well…

Page 17: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Let’s talk about style.

Page 18: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Miles Davis

Page 19: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Miles Daviscool

Page 20: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Miles Daviscool spare

Page 21: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Miles Daviscool spare deliberate

Page 22: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Miles Daviscool spare deliberate flawless

Page 23: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Miles DavisSought to make an individual, new sound.

Page 24: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

John Coltrane

Page 25: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

John Coltrane

avant guard

Page 26: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

John Coltrane

avant guard complex

Page 27: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

John Coltrane

avant guard complex chaotic

Page 28: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

John Coltrane

avant guard complex chaotic blemished

Page 29: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

John Coltrane

Sought the transcendent

through music.

Page 30: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Thelonious Monk

Page 31: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Thelonious Monk

unorthodox

Page 32: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Thelonious Monk

unorthodox eccentric

Page 33: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Thelonious Monk

unorthodox eccentric

discordant

Page 34: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Thelonious Monk

unorthodox eccentric

discordant perfect

Page 35: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Thelonious Monk

Made music like a fish swims in water

Page 36: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

I’m going to compare

programming languages.

Page 37: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

These languages are not so dissimilar.

Page 38: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

This is not a life or death

matter.

Page 39: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

This is a matter of right tool, right job.

Page 40: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Every language has an intrinsic philosophy of “good software”.

Page 41: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

The language designers’ choices influence what a language is most naturally useful for.

Page 42: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Sometimes a design goal is explicit.

Page 43: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Erlang

Page 44: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Soft real-time, concurrent and fault tolerant systems.

Page 45: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Subsystems may fail but the service as a whole remains online.

Page 46: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Failures cause sub-system restarts.

Page 47: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Restarts put the system back in a well-known state: prefer faults over error handling.

Page 48: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Let it crash!

Page 49: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Language features make crashes more likely.

Page 50: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Pattern Matching

No assignments:

Page 51: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Failed matches cause crashes.

Page 52: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Process Linking

Page 53: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Faults cascade up the process hierarchy.

Page 54: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Traps exist to survive child crashes but they are not on by default.

Page 55: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Strict process isolation.

Page 56: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

State changes are effected only through message passing.

Page 57: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Processes are sequential internally, concurrent to one

another.

Page 58: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

L F ELisp Flavored Erlang

Page 59: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Maintains semantic

equivalence to Erlang.

Page 60: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Lisp-2, Macros &

Homoiconicity

Page 61: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

A REPL, not just a

shell.

Page 62: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Erlang, in Lisp

Clothing

Page 63: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Let it crash!

Page 64: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Joxa

Page 65: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Lisp-1, Macros &

Homoiconicity

Page 66: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

A lisp that happens to run on

BEAM

Page 67: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Elixir

Page 68: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Solves the “Expression”

problem

Page 69: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Protocols

Page 70: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Streams / Iterables

Page 71: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Infix

Operators

Page 72: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Multiple function invocation styles

Page 73: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Metaprogramming

Page 74: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Multi-Assignments

Page 75: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Pattern Matching is non-default. Must use a prefix character to match.

Page 76: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Defaults callbacks for OTP

Behaviours

Page 77: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Which of these languages are production ready?

Page 78: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

What’s your risk tolerance?

Page 79: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

LFE 367 commits August 22, 2008 updated weekly 14 contributors

Page 80: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Joxa 470 commits November 25, 2011 updated monthly 8 contributors

Page 81: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Elixir 7618 commits January 9, 2011 updated daily 168 contributors

Page 82: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Erlang 14,273 commits Estd.1986 updated daily

227 contributors

Page 83: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Complexity

Page 84: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Complexity

Erlang

Page 85: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Complexity

Erlang LFE

Page 86: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Complexity

Erlang ElixirLFE

Page 87: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Software projects go through three stages: !

• exploration • stable development • maintenance

Page 88: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Experimentation

Stable Development

Maintenance

Page 89: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Different phases of the life-cycle express different needs.

Page 90: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Experimental: “Move fast, break stuff.”

Page 91: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Stable: “Go fast and mostly work.”

Page 92: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Maintenance: “Move slow, build things.”

Page 93: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

“Expressivity”, which is a boon while prototyping, can be a curse in more stable environments.

Page 94: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

“Intentional” languages may be too cumbersome in an environment of complete unknowns.

Page 95: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Complexity

C++Erlang ElixirLFE

Page 96: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

C++Erlang ElixirLFE

Page 97: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

None of the BEAM languages abandon what makes Erlang great (especially not Erlang).

Page 98: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Elixir targets the experimental, very beginnings of stable.

Page 99: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

LFE targets the tail end of experimental, beginning to mid of stable.

Page 100: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Erlang is a stable and maintenance stage sort of language.

Page 101: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Experimentation

Stable Development

Maintenance

Page 102: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Elixir

LFE

Erlang

Page 103: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Questions? <3

Page 104: Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlang Ecosystem

Thank you! @bltroutwine