Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Lispy Elixir
Search
Patrick Gombert
May 16, 2014
Technology
1
140
Lispy Elixir
Patrick Gombert
May 16, 2014
Tweet
Share
More Decks by Patrick Gombert
See All by Patrick Gombert
Introduction to Erlang (8LU)
patrickgombert
3
170
Other Decks in Technology
See All in Technology
GitLab Duo Agent Platform × AGENTS.md で実現するSpec-Driven Development / GitLab Duo Agent Platform × AGENTS.md
n11sh1
0
120
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.3k
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
4
1.7k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
データの整合性を保ちたいだけなんだ
shoheimitani
8
3k
GSIが複数キー対応したことで、俺達はいったい何が嬉しいのか?
smt7174
3
140
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
610
システムのアラート調査をサポートするAI Agentの紹介/Introduction to an AI Agent for System Alert Investigation
taddy_919
2
1.9k
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
560
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
1
300
配列に見る bash と zsh の違い
kazzpapa3
0
100
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
66k
WCS-LA-2024
lcolladotor
0
450
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Paper Plane
katiecoart
PRO
0
46k
Design in an AI World
tapps
0
140
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
270
Designing for Timeless Needs
cassininazir
0
130
Optimizing for Happiness
mojombo
379
71k
Evolving SEO for Evolving Search Engines
ryanjones
0
120
GraphQLとの向き合い方2022年版
quramy
50
14k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Transcript
Lispy Elixir @PatrickGombert
Lisp crash course (LISt Processing) () ; data structure (f)
; data structure and executable code (1 2 3) ; data structure without executable code ! ; closure definition ! ; program returning 4
Composability ; Higher order function ! ; Function returning a
function ! ; equivalent to !
Elixir is composable ; Higher order function ! ; Function
returning a function ! equivalent to
Homoiconicity - Code is represented as data (everything is a
list in lisp) - The resulting structure is a form of Abstract Syntax Tree (+ ; Root Node (+ ; Child of Root 1 ; Leaf Node 2) ; Leaf Node (+ ; Child of Root 3 ; Leaf Node 4)) ; Leaf Node !
Elixir is homocionic… ?
Look past syntax, you must
Quote This doesn’t print hello world, but why?
I heard you like programs in your programs
Elixir allows you to program while you program!
Homoiconic AST function arguments
Not quite as elegant… vs.
ISMETA (http://xkcd.com/917/) = =
! Erlang’s Parse-Transform http://www.erlang.org/doc/apps/erts/absform.html
… or lisp style macros! - Compile time (like parse-transform)
! - Homoiconic AST manipulation (like parse-transform) ! - Consistent AST (!!!)
defmacro ! ! - all at compile time - quoted
arguments - returning ASTs for the evaluation in the current module
None
None
None
List Comprehensions
And without the commas
It’s macros (almost) all the way down Turtle = Macro
Erm… umm…
! So of course…
None
Slow down cowboy It’s a context switch between compile &
run times
Macro bootstrap step https://github.com/elixir-lang/elixir/blob/master/lib/elixir/ src/elixir_bootstrap.erl
Splicing
Hygiene Note: Elixir is immutable so the rebinding is in
the local scope
Thanks! @PatrickGombert