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
830
The Research Omphalos
mrb
1
270
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
CloudNative Days Winter 2025: 一週間で作る低レイヤコンテナランタイム
ternbusty
7
1.6k
Stay Hacker 〜九州で生まれ、Perlに出会い、コミュニティで育つ〜
pyama86
2
2.3k
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
5
6.7k
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
12
7k
GraalVM Native Image トラブルシューティング機能の最新状況(2025年版)
ntt_dsol_java
0
160
Java_プロセスのメモリ監視の落とし穴_NMT_で見抜けない_glibc_キャッシュ問題_.pdf
ntt_dsol_java
0
220
Vueで学ぶデータ構造入門 リンクリストとキューでリアクティビティを捉える / Vue Data Structures: Linked Lists and Queues for Reactivity
konkarin
1
320
Evolving NEWT’s TypeScript Backend for the AI-Driven Era
xpromx
0
150
JEP 496 と JEP 497 から学ぶ耐量子計算機暗号入門 / Learning Post-Quantum Crypto Basics from JEP 496 & 497
mackey0225
2
450
2025 컴포즈 마법사
jisungbin
0
140
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
530
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
150
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Scaling GitHub
holman
464
140k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
A better future with KSS
kneath
239
18k
Why Our Code Smells
bkeepers
PRO
340
57k
Thoughts on Productivity
jonyablonski
73
4.9k
It's Worth the Effort
3n
187
29k
The Language of Interfaces
destraynor
162
25k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Navigating Team Friction
lara
190
16k
4 Signs Your Business is Dying
shpigford
186
22k
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