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
✨敗北解法コレクション✨〜Expertだった頃に足りなかった知識と技術〜
nanachi
1
770
いかにして命令の入れ替わりについて心配するのをやめ、メモリモデルを愛するようになったか(改)
nullpo_head
7
2.7k
「Roblox」の開発環境とその効率化 ~DAU9700万人超の巨大プラットフォームの開発 事始め~
keitatanji
0
140
MCPサーバーを活用したAWSコスト管理
arie0703
0
120
Telemetry APIから学ぶGoogle Cloud ObservabilityとOpenTelemetryの現在 / getting-started-telemetry-api-with-google-cloud
k6s4i53rx
0
160
家族の思い出を形にする 〜 1秒動画の生成を支えるインフラアーキテクチャ
ojima_h
3
1.3k
Autonomous Database Serverless 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
18
52k
Jamf Connect ZTNAとMDMで実現! 金融ベンチャーにおける「デバイストラスト」実例と軌跡 / Kyash Device Trust
rela1470
1
210
マルチプロダクト×マルチテナントを支えるモジュラモノリスを中心としたアソビューのアーキテクチャ
disc99
1
650
Amazon GuardDuty での脅威検出:脅威検出の実例から学ぶ
kintotechdev
0
130
React Server ComponentsでAPI不要の開発体験
polidog
PRO
0
340
AI時代の大規模データ活用とセキュリティ戦略
ken5scal
1
210
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
45
7.6k
Fireside Chat
paigeccino
39
3.6k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
Faster Mobile Websites
deanohume
309
31k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Why Our Code Smells
bkeepers
PRO
338
57k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
What's in a price? How to price your products and services
michaelherold
246
12k
Documentation Writing (for coders)
carmenintech
73
5k
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