Appearance
Glossary
Terms the pages use, with a short definition of each. On a page, the first mention of a term has a dotted underline: hover, focus or tap it for the definition. The definitions paraphrase the official Elixir docs, and each links to the page that explains the term properly.
- #Agent
- A simple wrapper around state: a process you read and update by passing functions.Read the page
- #Application
- Every Elixir project is an application, and so is Elixir itself (
:elixir) and parts of it such as:ex_unit.Read the page - #AST
- Abstract Syntax Tree. Elixir represents code as nested tuples shaped like a tree, and calls them quoted expressions.Read the page
- #Binary
- A bitstring whose number of bits is divisible by 8. Every binary is a bitstring, but not every bitstring is a binary.Read the page
- #Charlist
- A list of code points, written
~c"like this", mostly used for interoperability with Erlang.Read the page - #Child specification
- A map that tells a supervisor how to start, shut down and restart one child. It is usually written as
{module, options}or just the module name.Read the page - #Comprehension
- Syntactic sugar for looping over an enumerable, filtering and mapping, grouped into the
forspecial form.Read the page - #Doctest
- An example in a documentation string, written with an
iex>prompt and the expected result on the next line, checked as a test so documentation stays accurate.Read the page - #ETS
- Erlang Term Storage: the
:etsand:detsmodules store large data structures in memory or on disk.Read the page - #Exit signal
- The message a process sends along its links when it ends. A linked process that isn't trapping exits ends too, unless the reason is
:normal.Read the page - #GenServer
- A "generic server": a process that holds state and offers synchronous (call) and asynchronous (cast) requests, plus code reloading and more.Read the page
- #Guard
- An extra condition on a clause, written after
when. A clause only matches if the pattern matches and the guard is true.Read the page - #Link
- A relationship between two processes for the case of failure: if one fails, the other receives an exit signal. Without a link, a failure in one process never crashes another.Read the page
- #Macro
- Code that receives quoted expressions and transforms them into something else. Macros are harder to write than functions, and it is bad style to use them when they aren't needed.Read the page
- #Macro hygiene
- Macros have "late resolution": a variable defined inside a
quotewon't conflict with one in the code where the macro is expanded.Read the page - #Mailbox
- Where the messages sent to a process wait.
receive/1searches it for a message that matches a pattern. Sending does not block: the sender puts the message in the mailbox and carries on.Read the page - #Monitor
- A one-way way to track when a process dies, without tying exit signals together. When the monitored process ends, the watcher gets a message, whatever the reason.Read the page
- #Node
- A running Erlang VM that can connect to others. Processes are location transparent: sending a message works the same whether the recipient is on this node or another.Read the page
- #OTP
- Open Telecom Platform: the set of libraries that ships with Erlang, used to build robust, fault-tolerant applications. It includes supervision trees and event managers.Read the page
- #PID
- A process identifier. It is what
spawn/1returns and whatsend/2takes to reach that process.Read the page - #Pipe operator
|>takes the result of the expression on its left and passes it as the first argument of the call on its right, to highlight the data being transformed.Read the page- #Process
- Elixir's unit of concurrency: code always runs inside one. Processes are isolated, run concurrently and talk by passing messages. They are not operating system processes, and are lightweight enough to run in the hundreds of thousands.Read the page
- #Protocol
- A mechanism for polymorphism: behaviour varies with the data type, dispatching on the type of the first argument. Anyone can implement a protocol, at any time.Read the page
- #Quoted expression
- Elixir's name for the AST: code represented as nested tuples, which
quoteproduces andunquotesplices into.Read the page - #Sigil
- A custom textual representation. It starts with
~, then a letter and a delimiter, with optional modifiers after the last delimiter. You can define your own.Read the page - #Struct
- An extension built on top of maps that adds compile-time checks and default values.Read the page
- #Supervision tree
- Supervisors whose children can be supervisors themselves, so the processes of an application form a tree.Read the page
- #Supervisor
- A process that detects when its children die and starts new ones in their place. Processes are often linked to a supervisor for this.Read the page
- #Task
- An asynchronous computation: spawn it now and read its result later.Read the page
- #Trapping exits
- Setting
Process.flag(:trap_exit, true)so exit signals arrive as ordinary messages instead of ending the process. Supervisors do this to survive their children.Read the page