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

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 - Writing an Editor in Elixir - by @ijcd (Ian Duggan) Elixir for GUIs? Yes, it’s possible. I...
New
axelson
ElixirConf 2017 - Elixir The Toyota Way - Powell Kinney Toyota has a century-long legacy of innovation in ma...
New
axelson
Almost done with posting the Elixir Conf talks! ElixirConf 2017 - Realtime Vehicle Tracking with Elixir and Phoenix - @st23am ...
New
axelson
Let’s Talk Process Dictionary - @gregvaughn Well, the first rule of Fight Club, I mean: process dictionary is that we don’...
New
axelson
Consistent, Distributed Elixir - @keathley Elixir and Erlang provide powerful mechanisms for building systems that are alw...
New
axelson
ElixirConf US 2018 – Architecting Flow in Elixir - From Leveraging Pipes to Designing Token APIs – René Föhring (@rrrene) ...
New
axelson
ElixirConf US 2018 – Meet Virtuoso: The Chatbot Orchestration Framework Built with Elixir – Justus Eapen (@justuseapen) ...
New
axelson
ElixirConf US 2018 – Making a GraphQL Server with Absinthe & Dataloader – Aaron Votre (@shamshirz) The ...
New
axelson
ElixirConf US 2018 – Behavior Trees and Battleship: Tapping into the Power of Advanced Data Structures – Jeff Schomay ...
New
CodeSync
Code Sync: Vaxine, the Rich CRDT Database for ElixirPhoenix Apps | James Arthur | Code BEAM America 2022 Comments welcome! View the <spa...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
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
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
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement