Having the read the first chapter of the book, I don’t have much to say. I think it is a really good introduction to the BEAM, Erlang, and Elixir, with just the right amount of details.
Thanks for that introduction! Now I must try to live up to it.
I will take this opportunity to introduce myself and my experience of programming in Elixir.
I wrote my first Elixir programs in December of 2018. José posted a few screencasts showing the puzzles in Advent of Code. I immediately decided that I wanted to solve the puzzles while learning Elixir. It turned out that the puzzles themselves was the hardest part. Learning Elixir (enough to solve the puzzles) was easy. I read the crash course for Erlang developers to get going and then I learned more by looking at the other solutions in the forum, and especially at @sasajuric’s elegant solutions using Enum
, Stream
, and the pipe operator.
Here is a little about myself and my work in the OTP team.
I am the Björn in “Bogdan/Björn’s Erlang Abstract Machine (BEAM)” mentioned in the book.
I joined the OTP team at the end of 1996, and the first Erlang/OTP release in which some of my code was included was OTP R1D. A few years later, when the inventor of BEAM, Bogumil “Bogdan” Hausman, left Ericsson, I became the main developer responsible for BEAM.
To put that in context, I’ll need to explain how the meaning of the word “BEAM” has changed. Nowadays, the word “BEAM” (at least in common speech) seems to have evolved to mean the entire runtime system for Erlang. That it is also the sense used in the book.
At that time (OTP R1 through OTP R6 R5), there existed two Erlang implementations side by side: Joe Armstrong’s original JAM (Joe’s Abstract Machine) and BEAM. They shared the source of the runtime system (scheduler, BIFs, garbage collector, ETS, drivers, and so on).
“BEAM” at that time only referred to the part of the runtime system that executed the BEAM instructions. That is the part that I spent many years on improving and maturing so that it could replace JAM completely. My own invention in that area is the loader of BEAM code.
My blog post A Brief History of the BEAM Compiler goes beyond its title, giving more details on the early Erlang implementations in general, and BEAM and my involvement in its development in particular.
Returning to the book, the only thing that I think could have been added and is perhaps worth adding in the fourth edition, is a mention of the JIT (Just-In-Time compiler) in the Speed section. As written in the book, we in the OTP team do try to keep the performance as predictable as possible, but we also try to improve the raw performance with the goal to make it less frequently necessary to use libraries or programs implemented in C/C++/Rust. But my opinion in that matter is hardly unbiased.
Perhaps another language feature is worth emphasising: the bit syntax/binary syntax. It makes parsing of binary protocols much easier than in most other languages. For example, the PER encoding rules for ASN.1 is a nightmare to implement in other languages, but quite easy to implement in Erlang/Elixir using the bit syntax.