The Little Elixir & OTP Guidebook (Manning)

by Benjamin Tan Wei Hao

The Little Elixir & OTP Guidebook gets you started programming applications with Elixir and OTP. You begin with a quick overview of the Elixir language syntax, along with just enough functional programming to use it effectively. Then, you’ll dive straight into OTP and learn how it helps you build scalable, fault-tolerant and distributed applications through several fun examples.


About the technology

Elixir is an elegant programming language that combines the expressiveness of Ruby with the concurrency and fault-tolerance of Erlang. It makes full use of Erlang?s BEAM VM and OTP library, so you get two decades? worth of maturity and reliability right out of the gate. Elixir?s support for functional programming makes it perfect for modern event-driven applications.

About the book

The Little Elixir & OTP Guidebook gets you started writing applications with Elixir and OTP. You?ll begin with the immediately comfortable Elixir language syntax, along with just enough functional programming to use it effectively. Then, you?ll dive straight into several lighthearted examples that teach you to take advantage of the incredible functionality built into the OTP library.

What’s inside

  • Covers Elixir 1.2 and 1.3
  • Introduction to functional concurrency with actors
  • Experience the awesome power of Erlang and OTP
  • About the reader
  • Written for readers comfortable with a standard programming language like Ruby, Java, or Python. FP experience is helpful but not required.

About the author

Benjamin Tan Wei Hao is a software engineer at Pivotal Labs, Singapore. He is also an author, a speaker, and an early adopter of Elixir.

Don’t forget you can get 35% off the ebook using the code ‘devtalk.com:023:

1 Like

Does anyone know if this book is still relevant for the current versions of Elixir? I have realised that the author has not updated his code base in about 2 years.

I have been burnt with Elm… bought a 0.18 book and its incompatible with 0.19 :(.

Can you believe I bought this book back when it was in beta and I still haven’t got around to reading it! :icon_redface:

@bentanweihao is a member here so am pinging him as he’d be the best person to answer your query for you :023:

1 Like

One of the first books I read and it’s still very relevant. Otp hasn’t changed much, there are new mechanisms on top of it, but the fundamentals are all still there.

3 Likes

Ohai @drwolfe! Said author here. :D.

I don’t think there are going to be major changes in the code, primarily because I didn’t use anything particularly fancy. So in other words, but Elixir code is pretty basic and I don’t think there should be much changes.

I placed quite a bit of focus on how OTP works under the hood rather than “check out this cool syntactical feature!” (except pattern matching because pattern matching is cool).

Hope this makes sense.

11 Likes

I have sooooo many books that I haven’t gotten around to read yet … Life is hard.

3 Likes

I’m on a mission to read all professionally published Elixir books so I am sure I will get around to it one day Ben! :lol: Sorry it’s taking me so long :icon_redface:

3 Likes

Thanks! I will be purchasing your book.

3 Likes

In my case, the code didn’t work out of the box with the latest Elixir versions if you want to avoid warnings and stick to the latest changes in Elixir. The most important change as far as I can remember is that Supervisor.Spec has been deprecated. There were so many changes, that some of the exercises were never finished, even I tried to port them. So, you have been warned.

Thank you.

I ran into similar challenges as you, so I wrote blog posts about the pool supervision chapter (i.e. pooly) with code updated to Elixir 1.6 which may be of interest to you (and @drwolfe when you get there).

6 Likes

Is the discount code still valid? Is there a new one for 2019?

1 Like

Per Elixir Forum 2019 Update!, elixirforum should work

2 Likes

Example app Blitzy doesn’t work, sadly. I mean it works on local machine, and works in the same network, but when machines are on different network:

** (EXIT from #PID<0.133.0>) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started

Anyone knows a book that guides on how to write distributed application? Because this book seems to make you build unreliable crap that will tip over on slightest network delay.

Would not recommend.

Today I was reading reviews for The little Elixir and OTP guidebook at SafariBooks / Oreilly Learning and there was a review as follows;

Nice book to learn elixir by working on some interesting project. It can be good to start reading this book after some reference book like Introducing Elixir. However, as Elixir is a relatively young language and develops fast, many code snippets in this book are already outdated today (like :simple_one_to_one strategy or supervisor() function for child spec).

I wanted to start reading this book to grasp OTP better, as sadly I can’t buy the new book Designing Elixir Systems with OTP right now, but this review suggests that I may stuck at some point while following this book.

Do you guys recommend reading The little Elixir and OTP guidebook? If yes, what should I take care of to not stuck?

(Note: I also have Elixir in Action 2nd edition).

Then what are you waiting for?

4 Likes

Thank you for the reply!

I have this book, I agree with the above but Manning really needs to publish a 2nd edition with code examples updated for at least elixir 1.6/1.7. Dynamic Supervisor is missing from this book. If you want to learn about Dynamic Supervisor, with a reference to the books “Pooly” code see:

http://davidsulc.com/blog/2018/07/09/pooltoy-a-toy-process-pool-manager-in-elixir-1-6/

3 Likes

This why I love to use Docker for my development workflow…

So for this book I would check the release date for it, and use a docker image with the Elixir version more close to that date.

$ sudo docker run -it --name elixirapp elixir:1.3 bash                                                                                                                           
Unable to find image 'elixir:1.3' locally
1.3: Pulling from library/elixir
d660b1f15b9b: Pull complete 
46dde23c37b3: Pull complete 
6ebaeb074589: Pull complete 
e7428f935583: Pull complete 
c52465673432: Pull complete 
51bc68b788c7: Pull complete 
78a593679a61: Pull complete 
894bd32a127f: Pull complete 
Digest: sha256:815c87fdb1c148cb21e544fb0d604f6a231d7c913c40b93bc4ac80960039ad08
Status: Downloaded newer image for elixir:1.3

I have no name!@4883a44030f4:/$ iex
Erlang/OTP 19 [erts-8.3.5.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]

Interactive Elixir (1.3.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 

But for a proper development setup you need more, and I am almost finishing a docker stack for development in Elixir, that includes:

  • Elixir
  • Phoenix
  • PostgreSQL
  • Observer

So with this approach you quickly spin any Elixir version in your computer to do whatsoever you need and discard it afterwards without polluting your Operating system.

Or you could install asdf.

1 Like