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
Compiling a Dependently Typed Language to Ruby
Search
Michael Bernstein
June 12, 2015
Programming
3
200
Compiling a Dependently Typed Language to Ruby
A.K.A. "Compilers Are Dope And Also A Little Bit About Fancy Types"
Michael Bernstein
June 12, 2015
Tweet
Share
More Decks by Michael Bernstein
See All by Michael Bernstein
I'd like to introduce you to a few of my closest friends
mrb
1
4.6k
Papers We Love NYC: "Propositions As Types" By Philip Wadler
mrb
1
1.7k
Programs That Eat Programs
mrb
2
1.3k
Know Your Types
mrb
5
2.8k
The Art of Obsession
mrb
3
810
The Research Omphalos
mrb
1
260
Papers We Love: "A Unified Theory of Garbage Collection"
mrb
4
2.2k
Distributed Systems Archaeology
mrb
22
3k
GoRuCo 2013
mrb
11
4.8k
Other Decks in Programming
See All in Programming
AIネイティブなプロダクトをGolangで挑む取り組み
nmatsumoto4
0
120
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
240
GoのWebAssembly活用パターン紹介
syumai
3
10k
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
540
セキュリティマネジャー廃止とクラウドネイティブ型サンドボックス活用
kazumura
1
190
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
760
Cursor Meetup Tokyo ゲノミクスとCursor: 進化と制約のあいだ
koido
2
1k
イベントストーミングから始めるドメイン駆動設計
jgeem
4
870
Datadog RUM 本番導入までの道
shinter61
1
310
Effect の双対、Coeffect
yukikurage
5
1.4k
GoのGenericsによるslice操作との付き合い方
syumai
2
670
XSLTで作るBrainfuck処理系
makki_d
0
210
Featured
See All Featured
Scaling GitHub
holman
459
140k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Being A Developer After 40
akosma
90
590k
Why Our Code Smells
bkeepers
PRO
337
57k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Code Reviewing Like a Champion
maltzj
524
40k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
A Tale of Four Properties
chriscoyier
159
23k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Designing for humans not robots
tammielis
253
25k
Stop Working from a Prison Cell
hatefulcrawdad
270
20k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Transcript
Compiling A Dependently Typed Language To Ruby Michael R. Bernstein
RubyNation / 2015.6.12 / Silver Spring, Maryland
None
Why?
New ways of looking at how programs are designed, written,
executed, optimized, refactored, etc.
A New Lens
Compilers Are Dope And Also A Little Bit About Fancy
Types Michael R. Bernstein RubyNation / 2015.6.12 / Silver Spring, Maryland
None
None
None
None
Very Interesting
Why?
How?
Compilers
Compiler: - a computer program - that consumes computer programs
- and produces computer programs
Compiler: - a computer program - that does whatever you
want
[Animated image representing the sheer awesomeness of COMPILERS]
“Modern Compiler Implementation in ML” Appel
None
C ASM ????
X Y ????
Idris Ruby ????
Idris Ruby Rainbows, wizard dust, prayers, mystical insights, etc.
None
None
Intermediate Representations
None
Idris Ruby ????
LAMBDA CALCULUS
Everything that is computable can be expressed in terms of
the lambda calculus.
Everything that is computable can be compiled to the lambda
calculus.
Intermediate Representations Intermediate Representations Intermediate Representations Intermediate Representations Intermediate Representations
Intermediate Representations
TT TT Case IR Case IR Lift IR Defunc IR
ANF Idris ???
TT TT Case IR Case IR Lift IR Defunc IR
ANF Idris PHP
Tour and Demo!
None
DEEP BREATH
Type Systems
[Animated image representing the sheer awesomeness of TYPE SYSTEMS]
Dependent Types
Fancy Types
Expressive Types
pythag : Int -> List (Int, Int, Int) counter_rpc :
Int -> Maybe Int -> Process (Maybe Int) (Int,Int)
Program Phases
Syntax Check Compile Execute Test Type Check Write
Syntax Check Compile Execute Test Type Check Write
Syntax Check Compile Execute Test Type Check Write
More People To Read
Stephanie Weirich
Conor McBride
Philip Wadler
Works Cited
Sam Elliot, Edwin Brady, #idris, RubyNation & you! Acknowledgements
Thank You w michaelrbernste.in t @mrb_bk