You Should Learn Elixir
What is Elixir? Why learn it?
General purpose language
Functional
Concurrent
and
Parallel
Can cluster
Easy to use
Great tooling
Emphasis on Dev Happiness
The Free Lunch is Over
CPUs are no longer getting faster
We're getting more of them instead
Humans are bad at leveraging extra cores
Maybe we should try different abstractions
The Bad Old Days
Read concurrency book for your language
Throw threads at the concurrency problem
Throw locks at the race conditions from threads
Throw a threadpool at the problem
Sacrifice a goat
I don't even understand these errors
Elixir is built on Erlang, so let's just take a little detour
Erlang is Revolutionary
No more shared memory, no more threads, much fewer bugs
Uses virtual "processes" (isolated units of code that are scheduled and run by the virtual machine)
Processes communicate by sending messages asynchronously
Processes can choose to block (or not) on incoming messages and react to them
Erlang's VM is revolutionary
The BEAM (Erlang's VM) acts more like an OS
Schedules processes, and balances them across cores
Can use all cores to lower latency
or
use fewest possible cores to optimize power usage
Has a soft-real time aspect
Behaves well under high load
Behaves well with few resources (min req are about 16MB storage, 20MB RAM, a few hundred MHz, and 32MB RAM)
Libraries are called "Applications"
Applications can depend on each other and are like small fleets of microservices in your VM
Erlang's Error Handling is revolutionary
"Let it Crash" is a mantra about assertive coding
You always code the happy path first
You rarely write error handling code
Applications use supervisors to launch processes
Supervisors monitor a process and start and restart them according to a specified strategy
Supervisors can be assembled into trees and can bubble up as different parts of your application are affected by the outage
Crashes and Supervisors are a way your program returns to a "known good state", allowing your application to run well in the presence of bugs
Why hasn't Erlang eaten the world?
The Bad Old Days (Erlang)
Learn a weird syntax/language
Take days to set up project environment
Look around github for libraries
Consider if these problems are worse than the ones Erlang solves for you
Made with Slides.com