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
210
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.9k
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.9k
Other Decks in Programming
See All in Programming
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
780
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
650
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
170
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
920
Porting a visionOS App to Android XR
akkeylab
0
470
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
730
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
5
7.6k
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
400
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
700
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
3
490
「テストは愚直&&網羅的に書くほどよい」という誤解 / Test Smarter, Not Harder
munetoshi
0
180
Featured
See All Featured
How GitHub (no longer) Works
holman
314
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Speed Design
sergeychernyshev
32
1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Gamification - CAS2011
davidbonilla
81
5.4k
For a Future-Friendly Web
brad_frost
179
9.8k
GraphQLとの向き合い方2022年版
quramy
49
14k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Scaling GitHub
holman
460
140k
How to train your dragon (web standard)
notwaldorf
96
6.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
970
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