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.7k
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
820
The Research Omphalos
mrb
1
260
Papers We Love: "A Unified Theory of Garbage Collection"
mrb
4
2.2k
Distributed Systems Archaeology
mrb
22
3.1k
GoRuCo 2013
mrb
11
4.9k
Other Decks in Programming
See All in Programming
Claude Agent SDK を使ってみよう
hyshu
0
1.4k
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
250
Introducing RemoteCompose: break your UI out of the app sandbox.
camaelon
2
170
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
14
47k
ビルドプロセスをデバッグしよう!
yt8492
0
160
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
1
150
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.6k
Designing Repeatable Edits: The Architecture of . in Vim
satorunooshie
0
190
Introduce Hono CLI
yusukebe
6
3.2k
Using Types to Save Your Code's Future
rollbear
0
100
Node-REDのノードの開発・活用事例とコミュニティとの関わり(Node-RED Con Nagoya 2025)
404background
0
110
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
710
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.7k
Done Done
chrislema
186
16k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
940
Leading Effective Engineering Teams in the AI Era
addyosmani
7
680
How to Ace a Technical Interview
jacobian
280
24k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
Music & Morning Musume
bryan
46
6.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.9k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
2
200
Faster Mobile Websites
deanohume
310
31k
We Have a Design System, Now What?
morganepeng
53
7.9k
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