Elixir
Overview
Elixir is a dynamic, functional language designed for building scalable and maintainable applications, running on the Erlang VM (BEAM) and inheriting its lightweight-process concurrency and fault tolerance. It pairs an approachable Ruby-influenced syntax with OTP's battle-tested distribution and supervision model. Read this when writing Elixir, structuring OTP applications, or setting up the toolchain.
Official sources
Install / setup
The official install page lists install scripts as the quickest method. Verbatim (Bash):
curl -fsSO https://elixir-lang.org/install.sh && sh install.sh elixir@1.20.1 otp@28.4
PowerShell (Windows), verbatim from the same page:
curl.exe -fsSO https://elixir-lang.org/install.bat && .\install.bat elixir@1.20.1 otp@28.4
Source: https://elixir-lang.org/install.html (Homebrew alternative: brew install elixir)
Core concepts
- Immutability — data is never mutated in place; functions return new transformed values.
- Pattern matching — the
= match operator and function-head matching destructure and branch on data shape.
- The pipe operator
|> — threads a value through a series of function calls for readable data pipelines.
- Processes and the actor model — lightweight BEAM processes communicate by message passing, not shared memory.
- OTP behaviours — GenServer, Supervisor, and Application provide standard patterns for stateful, supervised, fault-tolerant systems.
- Mix — the build tool for creating projects, running tasks, managing dependencies (Hex), and testing.
Best practices
- Embrace the "let it crash" philosophy: supervise processes so failures restart cleanly rather than defensively guarding every error.
- Use pattern matching in function heads instead of nested conditionals for clear, declarative branching.
- Structure work into small pure functions and compose them with the pipe operator.
- Use Mix and the Hex package manager for dependencies and project tasks.
Common pitfalls
- Treating BEAM processes like OS threads or assuming shared mutable state → state lives inside a process and is changed only via messages.
- Overusing
try/rescue for control flow → prefer pattern matching and supervisors ("let it crash").
- Blocking a GenServer's single message loop with long synchronous work → offload heavy work to a separate process or Task.
Examples
defmodule Greeter do
def greet(name), do: "Hello, #{name}"
end
["ada", "grace"]
|> Enum.map(&String.capitalize/1)
|> Enum.each(&IO.puts(Greeter.greet(&1)))
Further reading
Related skills
- ../ruby — syntactic inspiration for Elixir
- ../scala — another language emphasizing functional programming on a managed VM
1---2name: elixir3description: Dynamic, functional language on the BEAM (Erlang VM) for scalable, fault-tolerant apps; consult for syntax, OTP, and setup.4domain: language5category: language6tags: [elixir, functional, beam, erlang, concurrency]7official_sources:8 - https://elixir-lang.org/docs.html9 - https://github.com/elixir-lang/elixir10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/elixir13---1415# Elixir1617## Overview18Elixir is a dynamic, functional language designed for building scalable and maintainable applications, running on the Erlang VM (BEAM) and inheriting its lightweight-process concurrency and fault tolerance. It pairs an approachable Ruby-influenced syntax with OTP's battle-tested distribution and supervision model. Read this when writing Elixir, structuring OTP applications, or setting up the toolchain.1920## Official sources21- Docs: https://elixir-lang.org/docs.html22- Repo: https://github.com/elixir-lang/elixir23- Install / download: https://elixir-lang.org/install.html2425## Install / setup26The official install page lists install scripts as the quickest method. Verbatim (Bash):2728```bash29curl -fsSO https://elixir-lang.org/install.sh && sh install.sh elixir@1.20.1 otp@28.430```3132PowerShell (Windows), verbatim from the same page:3334```powershell35curl.exe -fsSO https://elixir-lang.org/install.bat && .\install.bat elixir@1.20.1 otp@28.436```3738Source: https://elixir-lang.org/install.html (Homebrew alternative: `brew install elixir`)3940## Core concepts41- Immutability — data is never mutated in place; functions return new transformed values.42- Pattern matching — the `=` match operator and function-head matching destructure and branch on data shape.43- The pipe operator `|>` — threads a value through a series of function calls for readable data pipelines.44- Processes and the actor model — lightweight BEAM processes communicate by message passing, not shared memory.45- OTP behaviours — GenServer, Supervisor, and Application provide standard patterns for stateful, supervised, fault-tolerant systems.46- Mix — the build tool for creating projects, running tasks, managing dependencies (Hex), and testing.4748## Best practices49- Embrace the "let it crash" philosophy: supervise processes so failures restart cleanly rather than defensively guarding every error.50- Use pattern matching in function heads instead of nested conditionals for clear, declarative branching.51- Structure work into small pure functions and compose them with the pipe operator.52- Use Mix and the Hex package manager for dependencies and project tasks.5354## Common pitfalls55- Treating BEAM processes like OS threads or assuming shared mutable state → state lives inside a process and is changed only via messages.56- Overusing `try/rescue` for control flow → prefer pattern matching and supervisors ("let it crash").57- Blocking a GenServer's single message loop with long synchronous work → offload heavy work to a separate process or Task.5859## Examples60```elixir61defmodule Greeter do62 def greet(name), do: "Hello, #{name}"63end6465["ada", "grace"]66|> Enum.map(&String.capitalize/1)67|> Enum.each(&IO.puts(Greeter.greet(&1)))68```6970## Further reading71- Getting started & guides: https://elixir-lang.org/docs.html72- Installation details and version managers: https://elixir-lang.org/install.html7374## Related skills75- ../ruby — syntactic inspiration for Elixir76- ../scala — another language emphasizing functional programming on a managed VM