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.5k
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
790
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
The Weight of Data: Rethinking Cloud-Native Systems for the Age of AI
hollycummins
0
270
Preact、HooksとSignalsの両立 / Preact: Harmonizing Hooks and Signals
ssssota
1
1.5k
AI Agents with JavaScript
slobodan
0
220
Sharing features among Android applications: experience feedback
jbvincey
0
100
Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership
cyrilmottier
2
270
タイムゾーンの奥地は思ったよりも闇深いかもしれない
suguruooki
1
620
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
320
The Evolution of the CRuby Build System
kateinoigakukun
0
690
ComposeでWebアプリを作る技術
tbsten
0
110
Devinのメモリ活用の学びを自社サービスにどう組み込むか?
itarutomy
0
2.1k
AWS で実現する安全な AI エージェントの作り方 〜 Bedrock Engineer の実装例を添えて 〜 / how-to-build-secure-ai-agents
gawa
8
780
海外のアプリで見かけたかっこいいTransitionを真似てみる
shogotakasaki
1
170
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.4k
4 Signs Your Business is Dying
shpigford
183
22k
Unsuck your backbone
ammeep
670
57k
Facilitating Awesome Meetings
lara
54
6.3k
Faster Mobile Websites
deanohume
306
31k
StorybookのUI Testing Handbookを読んだ
zakiyama
29
5.6k
Designing for humans not robots
tammielis
252
25k
Navigating Team Friction
lara
184
15k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.6k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
The Pragmatic Product Professional
lauravandoore
33
6.5k
Typedesign – Prime Four
hannesfritz
41
2.6k
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