An Animated Introduction to Elixir
Tags: elixir, tutorial, functional
Published: 2022-10-20 02:12:03

This is a collection of guided code walk-throughs introducing the functional, concurrent programming language, Elixir. Elixir is based on another really cool language called Erlang. If you have never programmed in the functional paradigm or explicitly created and managed processes then learning Elixir should be a fascinating introduction into these topics.

I begin by covering the basics of the Elixir programming language. Elixir is a functional programming language that relies heavily on pattern matching. Pattern matching makes it so that you almost never need to write an 'if statement'. Elixir also has immutable data. Immutable data cannot change. I discuss 'efficient immutability' and the built in data structures throughout the book. 

Elixir has excellent support for high order functions to process collections of data. These high order functions make it so that you rarely need to write a traditional loop. Elixir supports tail call optimizations for recursive functions which also helps reduce the number of loops that one has to write.

In the second part of this tutorial, I cover concurrency in Elixir. Elixir makes it easy to create many communicating processes. Using processes really changes the way one thinks about solving problems. Each process has its own flow of control, call stack, and mailbox used to receive and queue messages sent from other processes. There are built in functions so that one process can send and receive messages to others. I go over a few interesting problems that use processes in this chapter.

Part 1 Elixir
[1.1 Hello Elixir!!!](https://markm208.github.io/exbook/chapter1/01/index.html)
[1.2 Numbers and the Match Operator](https://markm208.github.io/exbook/chapter1/02/index.html)
[1.3 Functions and More Matching](https://markm208.github.io/exbook/chapter1/03/index.html)
[1.4 Modules and More Matching with SimpleMath](https://markm208.github.io/exbook/chapter1/04/index.html)
[1.5 Closures](https://markm208.github.io/exbook/chapter1/05/index.html)
[1.6 Ranges and the Enum Module](https://markm208.github.io/exbook/chapter1/06/index.html)
[1.7 Tuples](https://markm208.github.io/exbook/chapter1/07/index.html)
[1.8 Maps](https://markm208.github.io/exbook/chapter1/08/index.html)
[1.9 SimpleDateFormatter Module with Maps](https://markm208.github.io/exbook/chapter1/09/index.html)
[1.10 Lists, Matching, and Recursion](https://markm208.github.io/exbook/chapter1/10/index.html)
[1.11 Poker Probabilities](https://markm208.github.io/exbook/chapter1/11/index.html)
[1.12 Recursion in Elixir](https://markm208.github.io/exbook/chapter1/12/index.html)

Part 2 Concurrency
[2.1 Adding Tests to the Mix](https://markm208.github.io/exbook/chapter2/01/index.html)
[2.2 Process Basics](https://markm208.github.io/exbook/chapter2/02/index.html)
[2.3 Prime Sieve](https://markm208.github.io/exbook/chapter2/03/index.html)
[2.4 Calendar with Processes](https://markm208.github.io/exbook/chapter2/04/index.html)
[2.5 Poker with Processes](https://markm208.github.io/exbook/chapter2/05/index.html)

I have more tutorials here: [https://markm208.github.io](https://markm208.github.io)

If you'd like to stay connected and get updates when I add new playbacks you can follow me on twitter: [@markm208](https://twitter.com/markm208). You can contact me directly at markm208@gmail.com. Let me know what you think!