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
190
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.4k
Papers We Love NYC: "Propositions As Types" By Philip Wadler
mrb
1
1.6k
Programs That Eat Programs
mrb
2
1.3k
Know Your Types
mrb
5
2.8k
The Art of Obsession
mrb
3
780
The Research Omphalos
mrb
1
250
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
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
200
負債になりにくいCSSをデザイナとつくるには?
fsubal
10
2.4k
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
140
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
37
14k
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
220
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
PHP ステートレス VS ステートフル 状態管理と並行性 / php-stateless-stateful
ytake
0
100
Software Architecture
hschwentner
6
2.1k
ソフトウェアエンジニアの成長
masuda220
PRO
10
1.1k
Amazon S3 TablesとAmazon S3 Metadataを触ってみた / 20250201-jawsug-tochigi-s3tables-s3metadata
kasacchiful
0
170
チームリードになって変わったこと
isaka1022
0
200
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
230
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
A Tale of Four Properties
chriscoyier
158
23k
A Modern Web Designer's Workflow
chriscoyier
693
190k
For a Future-Friendly Web
brad_frost
176
9.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Building Your Own Lightsaber
phodgson
104
6.2k
Side Projects
sachag
452
42k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Site-Speed That Sticks
csswizardry
4
380
Typedesign – Prime Four
hannesfritz
40
2.5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Unsuck your backbone
ammeep
669
57k
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