axelson

axelson

Scenic Core Team

5) ElixirConf 2017 - Don't Write Macros But Do Learn How They Work - Jesse Anderson

Here’s today’s talk:

ElixirConf 2017 - Don’t Write Macros But Do Learn How They Work - by @jessejanderson

You may have heard that “most of Elixir was written in Elixir” but what does that even mean, and how is that possible? Metaprogramming allows us to write code that writes code and, in addition to powering most of Elixir itself, has allowed for many great projects including Phoenix to exist. Even if you don’t have ambitions to create the next Phoenix, understanding metaprogramming basics and learning how the Elixir expressions work under the hood can lead to greater understanding of the code you write every day.

All talks are available in the Elixir Conf 2017 Talks List

Most Liked Responses

JEG2

JEG2

Author of Designing Elixir Systems with OTP

Seems like a worthy goal to me and I would say that you nailed it.

jessejanderson

jessejanderson

Thanks for the feedback everyone, I really appreciate it!

@sillypog
Great to see you again at the conf - thanks for the kind words! The trick I’ve found is to trip up a lot myself, and then just try to document everything that didn’t make any sense to me. :stuck_out_tongue:

@JEG2
For sure, I’d love to have had another 30 minutes to talk so I could go deeper! :grin: I personally don’t have a ton of programming history prior to Elixir, so how macros work and especially the AST in general were difficult concepts for me to learn. I’ve heard some excellent talks that started just a couple levels above where my own knowledge was, so at the time I didn’t learn much because I couldn’t follow along.

So my top goal for this talk was that someone with very little background would walk out of the talk understanding 90% of what was covered, and that they could then watch any other Macro talks and be able to easily follow along by recognizing the same concepts. I also went long every time I did a run-through of the talk so I ended up cutting a couple of examples at the end that would’ve introduced a few more of concepts of Macros (e.g. I really wanted to do an example of __using__ but just didn’t have the time).

@axelson
As some others said, the reason for the 2-element tuple is to allow for the syntax of keyword lists, which I think might be important for the maintaining of do/else/etc blocks inside of the AST. I was planning to cover this in my original talk but had to cut it for time at the last minute. I’ve got the slide to prove it! There’s some additional info (though not a ton) in the Official Docs: Syntax Reference.

Also, could you add the elixirconf2017 tag to this post, thanks!

AstonJ

AstonJ

/Side note/

You can use a hash to auto-link to a tags page when in a post, e.g.: elixirconf2017 :023:

Where Next?

Popular in Talks Top

axelson
ElixirConf 2017 - Implementing a MQTT client in Elixir - @gausby Elixir has excellent support for binary pat...
New
axelson
ElixirConf 2017 - The Power of Zero - Andrew Forward Automation is hard, but the benefits can be phenomenal....
New
ElixirConf
ElixirConf: ElixirConf 2023 - Tim Gremore - Replacing React: How Liveview solved our performance problems Comments welcome! View the <sp...
New
New
brightball
Since the comments are turned off on the YouTube videos, I’m going to post on talk per day on here for viewing and discussion…starting wi...
New
axelson
ElixirConf US 2018 – Making a GraphQL Server with Absinthe &amp; Dataloader – Aaron Votre (@shamshirz) The ...
New
rodrigues
Whether you’re developing a small web site or a large-scale distributed system, Erlang and Elixir are great tools for building server-sid...
New
axelson
Posting a little bit late today but here you go: ElixirConf 2017 - Elixir + Neo4j - Regina Imhoff Neo4j is ...
New
axelson
ElixirConf 2017 - Managing Tables With Elixir and OTP - Robert Beene We’ve all waited for a table at a resta...
New
CodeSync
Code Sync: Celebrating the 10 Years of Elixir | José Valim | ElixirConf EU 2022 Comments welcome! View the <span class="hashtag-icon-pl...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 53690 245
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52341 488
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; "XXX...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement