AstonJ

AstonJ

Metaprogramming Elixir (Pragprog)

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

Most Liked

chrismccord

chrismccord

Creator of Phoenix

The book is still 100% relevant and there’s not yet a need for a 2nd edition as Elixir’s AST and metaprogramming features are fortunately quite stable. I think the only thing that needs updated in the book today is the break feature of the while macro will warn on null arity parens :slight_smile:

frigidcode

frigidcode

$7.15 for the ebook, that’s a steal!

Ted

Ted

I picked up Metaprogramming Elixir during PragProg’s recent Christmas in July sale; the book is already modestly priced but was a steal with the discount.

I’m fairly new to Elixir, so my original intent was to read the book once I had a bit more exposure and experience under my belt.

But then I thought, “Well, I already have a rudimentary familiarity with macros from dabbling in Clojure (a lisp). I’ll be learning Ecto and Phoenix soon and I know there are some DSLs and use going on there, so it’d be really nice to have some intuition about what’s happening under the hood. Let’s just take a little peek at the first chapter and see.”

I was hooked.

Chris McCord’s clear writing style and obvious focus on reader ergonomics, e.g., repeating relevant bits of code, makes the book very readable and engaging.

Regarding content, there were plenty of moments where I thought, “wait, we’re going to do what next?! Okay, I’ve got time to read a few more pages…”

And, as I had hoped, the book covers DSLs and use, but it also covered so much more.

I was introduced to Elixir’s AST and the concept of macro hygiene, along with repeatable recipes for building DSLs and testing macros.

As an Elixir noob, I don’t think I’ll be writing my own for-real macros just yet, but I feel that I’ve gain a lot of valuable intuition about how the language works, which was my goal.

This is definitely a resource I’ll revisit once I get more experience.

Thank you @chrismccord!

Other notes:

I read the book cover-to-cover in about three days, mostly during lunch breaks and at bedtime.

I recommend reading the book start-to-finish.

I found the book to be e-reader friendly (Kindle Paperwhite, landscape).

blatyo

blatyo

Conduit Core Team

I’ve read it and I liked it. It covers generating code from an external file, which is about 80% of the macro code I write. The section on generating an HTML DSL, is probably the least useful for me. I believe at some point it started using an actor to track changes, which I didn’t really like. The Phoenix router DSL is pretty interesting, but the patterns used there weren’t in the book. So, I recommend diving into the Phoenix, Plug, and Ecto code after reading the book. I’d say the book gave me the building blocks to read and understand those. Reading those, personally gave me a better idea of what’s possible.

sfusato

sfusato

I have just followed the book with no stumbling blocks along the way. I honestly expected to face some issues considering when the book was released, but other than some deprecation warnings which were expected, everything else was smooth sailing.

Solid book with very practical examples. Thank you Chris!

Where Next?

Popular in Books Top

PragmaticBookshelf
Alexander Koutmos @akoutmos Elixir Patterns aims to surface the powerful and unique characteristics of the Erlang virtual machine and sho...
New
wintermeyer
At https://elixir-phoenix-ash.com I publish training material for Elixir and Phoenix. Text base tutorials which start at zero. Recently I...
New
CinderellaMan
Hands-on Elixir & OTP: Cryptocurrency Trading Bot by Kamil Skowron Want to learn Elixir & OTP by creating a real-world project...
New
tristan
Adopting Erlang is a collaborative effort between myself (Tristan), Fred Hebert and Evan Vigil-McClanahan. It is an ongoing effort to gat...
New
peerreynders
Don’t forget you can get 35% off the ebook with your forum discount, use code ‘devtalk.com’ :023: Available in beta now
New
AstonJ
by Wolfgang Loder Learn and understand Erlang and Elixir and develop a working knowledge of the concepts of functional programming that...
New
AstonJ
A short and personal history of the book I, Erik Stenman (Happi), started writing this book back in 2013. At first I was thinking of sel...
New
AstonJ
by Joe Armstrong A multi-user game, web site, cloud application, or networked database can have thousands of users all interacting at th...
New
codestirring
Hey Elixir Forum, I’ve written a ebook called the Phoenix LiveView Cookbook which I’ve written in the hopes of distilling the knowledge ...
New
AstonJ
by Dave Thomas This book is the introduction to Elixir for experienced programmers, completely updated for Elixir 1.6 and beyond. Explor...
New

Other popular topics Top

peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement