What Elixir Does
- Functional — immutable data, pattern matching, pipe operator
- Actor model — lightweight processes (millions per node)
- OTP — supervision trees, GenServer, Agent, Task
- Fault tolerance — let it crash philosophy, supervised restarts
- Distribution — connect nodes across machines
- Hot code reload — swap code without downtime
- Phoenix — high-performance web framework
- LiveView — server-rendered real-time UI without JS
- Ecto — database abstraction with changesets and query DSL
- Mix — build tool, tasks, compiler, tests
- ExUnit — built-in test framework
Architecture
Elixir code compiles to Erlang bytecode and runs on BEAM VM. Each process is isolated (own heap), messages are passed by copy, and the scheduler is preemptive across processes. Supervisors restart failed children per a declared strategy. Cluster formation via Erlang Distribution Protocol.
Self-Hosting
Language toolchain.
Key Features
- BEAM VM (Erlang runtime)
- Millions of lightweight processes
- Actor model messaging
- OTP supervision trees
- Hot code upgrade
- Distributed clustering
- Pattern matching
- Pipe operator for data flow
- Phoenix web framework
- LiveView for real-time UIs
- Mix build tool
Comparison
| Language | Runtime | Concurrency | Fault Tolerance |
|---|---|---|---|
| Elixir | BEAM | Actor model | Supervision |
| Erlang | BEAM | Actor model | Supervision |
| Go | Native | Goroutines | Manual |
| Scala (Akka) | JVM | Actor model | Supervision |
| Rust | Native | Async + threads | Result types |
| Java | JVM | Threads + Loom | Exceptions |
FAQ
Q: Elixir vs Erlang? A: Same VM (BEAM), different syntax. Elixir has a more modern syntax (Ruby-ish), more powerful macros, and a friendlier Mix toolchain. Erlang syntax is closer to Prolog, familiar to veterans. New projects should prefer Elixir.
Q: What is LiveView? A: Phoenix's signature feature — server-side rendered UI that pushes diffs to the browser via WebSocket. Zero-JS real-time UIs with experience close to React but without the frontend/backend split.
Q: What scenarios is it for? A: Real-time applications, chat, game servers, IoT backends, high-concurrency APIs, and systems needing fault tolerance. WhatsApp, Discord, and Pinterest all use it.
Sources
- Docs: https://elixir-lang.org/docs.html
- GitHub: https://github.com/elixir-lang/elixir
- License: Apache 2.0