Chris McCord

Pragmatic Programmers


book eBook


95%
31.0% 65.0% 4.0%

Check price

Metaprogramming Elixir

Write code that writes code with Elixir macros. Macros make metaprogramming possible and define the language itself.

In this book, you’ll learn how to use macros to extend the language with fast, maintainable code and share functionality in ways you never thought possible. You’ll discover how to extend Elixir with your own first-class features, optimize performance, and create domain-specific languages.


Reviews

Steven @StevenXL
There are two great resources out there for learning Elixir's metaprogramming capabilities - @chrismccord's Metaprogramming Elixir and @sasajuric's Understanding Elixir Macros mini-series.

positive

Myronmarston @myronmarston
@josevalim I think there's a bit of a whole in the documentation regarding this stuff. I've read @chrismccord's Metaprogramming Elixir and the Elixir docs regarding macros and quote and I don't really think it provides the necessary concepts to understand this kind of issue (at least not for how my brain thinks, apparently). Are there some simple ways we can improve the docs regarding this? I'm thinking maybe a doc explaining macro expansion phases in more detail and how evaluation order may not match what you'd expect. And also maybe the docs on the Module attribute functions could mention this gotcha. It definitely surprised me.

positive

@hotpancakes
I've been reading Chris's excellent "Metaprogramming Elixir" and "Designing for Scalability with Erlang/OTP". It got me wondering, how long does it typically take you to read a technical book?

positive

Jeff Deville @jeffdeville
I was following (I hope) Chris's guidelines in Metaprogramming Elixir, so I have the overall macro split across multiple files.

positive

Jeff Deville @jeffdeville
This compiles, but none of my methods are defined. It seems wrong that my AST is a list, and not a tree, but the same is true for the Translator module from Metaprogramming Elixir, and it's still working. I suppose this isn't the top of the tree anyway.

positive

Brian van Burken @brianvanburken
I also recommend to read Metaprogramming Elixir by Chris McCord (the person who build the Phoenix framework) https://pragprog.com/book/cmelixir/metaprogramming-elixir.

positive

@uri
Originally I got the idea to do this from Chris McCord's Metaprogramming Elixir, but is there a better way to handle this?

positive

Norbert Melzer @NobbZ
If you want to go deeper into macros and metaprogramming, I'd suggest to read Metaprogramming Elixir by @chrismccord.

positive

Christiansakai @christiansakai
* Metaprogramming Elixir

neutral

Jonathan Soifer @jaysoifer
• Metaprogramming Elixir (USD 14.88)

neutral

Johan Wärlander @jwarlander
Metaprogramming Elixir

neutral

Kien Nguyen Trung @kiennt
@sashaafm you could read more about this technique in the book "Metaprogramming Elixir", chapter 3

neutral

Mike Buhot @mbuhot
Metaprogramming Elixir

neutral

Olivier Boudry @oboudry
I'm reading and playing around the PragProg book Metaprogramming Elixir.

neutral

Olivier Boudry @oboudry
It's on my reading list right after finishing "Metaprogramming Elixir". Can't wait to learn more on OTP!

neutral

Willie Loh @willieLOH
* Metaprogramming Elixir

neutral

Sasha Fonseca @sashaafm
The Metaprogramming Elixir book also doesn't cover this aspect of testing macros, I believe.

neutral

Dina @soundstruck
I have Metaprogramming Elixir, but need to come back to that one.

neutral

Aston @AstonJ
Metaprogramming Elixir

neutral

Aston @AstonJ
Metaprogramming Elixir

neutral

Aston @AstonJ
Metaprogramming Elixir

neutral

@Crowdhailer
Any pointers would be greatly received or some resources to some more advanced macro tutorial, so far I have read Metaprogramming Elixir and looked at the Plug source code but to no avail

neutral

Norbert Melzer @NobbZ
And of course there is the book "Metaprogramming Elixir" by @chrismccord, published by pragmatic bookstore.

neutral

@peerreynders
Metaprogramming Elixir

neutral

Voger @voger
I just finished "Programming Elixir" and now I am reading "Metaprogramming Elixir". I can't say I comprehend everything.

neutral

Sasha Fonseca @sashaafm
I forgot I also got Metaprogramming Elixir.

negative