Elixir course

Elixir is a functional language for systems that have to stay up: it runs on the Erlang virtual machine, it keeps its state in cheap processes, and it lets a crash restart a part instead of the whole program. This course takes that idea from a first value in the shell to an application with a supervision tree.

The course is written in chapters, and each chapter opens with a page like this one: a short introduction, a card for every lesson and a tree of the chapter. Read a chapter in order, or follow the previous and next links at the bottom of a page. Start with What is Elixir and where it runs, or read Elixir basics for a page on the language and its tools.

Every program in the course is a whole file that runs, and every output block is the output of that run. The lessons stay on Elixir and OTP, because the standard library is enough for a service; a package such as Phoenix or Ecto is described where it belongs and marked as not run.

Elixir course: Start What Elixir is, the BEAM it runs on, the install on each system, the shell and a first script. Open Elixir course: The language basics Values and variables, numbers, strings and atoms, the truthiness rule, conditions and the operators. Open λ Elixir course: Functions and pattern matching Functions and their clauses, pattern matching, case, the pipeline, recursion and the pipe operator. Open Elixir course: Modules and data Modules and the import family, structs as named data, protocols for dispatch and behaviours as contracts. Open Elixir course: Collections and Enum Lists, tuples, maps and keyword lists, then Enum over all of them, the group and the sort. Open Elixir course: Streams and comprehensions Lazy pipelines with Stream, comprehensions, ranges, and a file read line by line. Open A Elixir course: Strings, sigils and binaries Unicode text and the String module, the sigils, binaries at the byte level and the charlists of Erlang. Open Elixir course: Errors, files and I/O Exceptions and the ok tuple, try and rescue, files, paths, and the input and output of a program. Open Elixir course: Processes and concurrency Spawned processes, messages, links and monitors, then Task, Agent and state that lives in a process. Open Elixir course: OTP GenServer, supervisors, applications, Registry, DynamicSupervisor, ETS and the restart strategy. Open Elixir course: Mix, tests and quality A Mix project, its dependencies and configuration, ExUnit and doctests, typespecs, formatting, Credo and debugging. Open Elixir course: Releases and capstone projects A release, the networking of OTP, the errors a beginner meets, and three capstone projects built and run. Open

All chapters