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
Joseph Koski Series editor: Sophie DeBenedetto @SophieDeBenedetto Developmental editor Adaobi Obi Tulton @aotulton Combine advanced fu...
New
PragmaticBookshelf
Rebecca Le and Zach Daniel @zachdaniel _edited by Kelly Lee @k.lee _ Ash Framework is the game-changing toolkit for Elixir developers. W...
New
radar
by Ryan Bigg Joy of Elixir came about because I saw that there was not very much when it comes to absolute beginner material for lear...
New
DevotionGeo
https://www.packtpub.com/web-development/phoenix-web-development
New
PragmaticBookshelf
Svilen Gospodinov edited by Jacquelyn Carter @jkcarter Learn different ways of writing concurrent code in Elixir and increase your appli...
New
vincentvanbush
Hey! Happy to announce the Elixir Adoption Guide by Curiosum, announced during this year’s ElixirConf EU, is out to the public now :slig...
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
germsvel
:wave: Hi there, I’ve been working on a Test-Driven Development with Phoenix book. It teaches TDD and BDD by building a chat app from th...
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
peerreynders
Don’t forget you can get 35% off the ebook using the code ‘devtalk.com’ :023: This title will be available on or about 2018-11-10
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
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
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New

We're in Beta

About us Mission Statement