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
Know Your Types
Search
Michael Bernstein
June 21, 2014
Technology
3k
5
Share
Know Your Types
GoRuCo 2014
Michael Bernstein
June 21, 2014
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.8k
Papers We Love NYC: "Propositions As Types" By Philip Wadler
mrb
1
1.7k
Compiling a Dependently Typed Language to Ruby
mrb
3
220
Programs That Eat Programs
mrb
2
1.3k
The Art of Obsession
mrb
3
870
The Research Omphalos
mrb
1
280
Papers We Love: "A Unified Theory of Garbage Collection"
mrb
4
2.3k
Distributed Systems Archaeology
mrb
22
3.1k
GoRuCo 2013
mrb
11
5k
Other Decks in Technology
See All in Technology
世界の中心でApp Runnerを叫ぶ FINAL
tsukuboshi
0
250
Sociotechnical Architecture Reviews: Understanding Teams, not just Artefacts
ewolff
1
150
AI対話分析の夢と、汚いデータの現実 Looker / Dataplex / Dataform で実現する品質ファーストな基盤設計
waiwai2111
0
240
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
100k
Swift Sequence の便利 API 再発見
treastrain
1
170
Building Production-Ready Agents Microsoft Agent Framework
_mertmetin
0
160
カオナビに Suspenseを導入するまで / The Road to Suspense at kaonavi
kaonavi
1
430
Modernizing Your HCL Connections Experience: Visual Report to chain, Profile Enhancements, and AI Integration
wannesrams
0
290
CyberAgent YJC Connect
shimaf4979
1
170
そのSLO 99.9%、本当に必要ですか? 〜優先度付きSLOによる責任共有の設計思想〜 / Is that 99.9% SLO really necessary? Design philosophy of shared responsibility through prioritized SLOs
vtryo
0
190
AIが盛んな時代に 技術記事を書き始めて起きた私の中での小さな変化
peintangos
0
360
AI時代の品質はテストプロセスの作り直し #scrumniigata
kyonmm
PRO
4
1.4k
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
130
Tell your own story through comics
letsgokoyo
1
910
The untapped power of vector embeddings
frankvandijk
2
1.7k
Site-Speed That Sticks
csswizardry
13
1.2k
Agile that works and the tools we love
rasmusluckow
331
21k
WENDY [Excerpt]
tessaabrams
10
37k
AI: The stuff that nobody shows you
jnunemaker
PRO
6
630
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
220
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The Language of Interfaces
destraynor
162
26k
Transcript
Know Your Types Michael R. Bernstein June 2014 Gotham Ruby
Conference, NYC w michaelrbernste.in t @mrb_bk
I’m Obsessed
None
What Are Types?
“What we talk about when we talk about types” Benton,
2014
“We don't talk about types, we argue about them.”
“Type Systems” Cardelli, 1996
None
Computer Science Skill 0 25 50 75 100 Homepage Design
Outdatedness Computer Science Skill vs. Homepage Design Outdatedness
Computer Science Skill 0 25 50 75 100 Homepage Design
Outdatedness Bernstein’s Law
“A collection of values. An estimate of the collection of
values that a program fragment can assume during program execution.” Type
int bool string int -> bool
“A component of a type system. A rule stating the
conditions under which a particular program construct will not cause forbidden errors.” Type Rule
None
“A collection of type rules for a typed programming language.
Same as static type system.” Type System
None
“A language where good behavior is determined before execution.” Statically
checked language
“A language where good behavior is enforced during execution.” Dynamically
checked language
“The process of checking a program before execution to establish
its compliance with a given type system and therefore to prevent the occurrence of forbidden errors.” Typechecking
“The process of finding a type for a program within
a given type system.” Type Inference
How Can Types Help Us?
“Propositions as Types” Wadler, 2014
None
None
Isomorphism
iso morph
equal shape
Propositions are Types
None
Proofs are Programs
Normalization of proofs is evaluation of programs
None
None
None
None
None
Deep Understanding
Mathematical Certainty
Enlightenment
“Types and Programming Languages” a.k.a ‘TAPL’ Pierce, 2002
Detecting Errors
Abstraction
Documentation
Safety
So Much More!
Types and Ruby (But Really Dynamic Languages in General)
“A Practical Optional Type System for Clojure” Bonnaire-Sergeant,2012
None
“Typed Scheme: From Scripts to Programs” Tobin-Hochstadt, 2010
“Gradual Typing for Functional Languages” Siek & Taha, 2006
Gradual Typing
“…safe interoperability between typed and untyped portions of a single
program” ! - Sam Tobin-Hochstadt
“Dynamic Inference of Static Types for Ruby” An, Chaudhuri, Foster,
Hicks, 2011
“…constraint-based dynamic type inference, a technique that infers static types
based on dynamic program executions.”
None
“The Ruby Type Checker” Ren, Toman, Strickland, Foster 2013
“RTC is designed so programmers can control exactly where type
checking occurs: type-annotated objects serve as the “roots” of the type checking process, and unan- notated objects are not type checked.”
None
Challenges
“Experience from Developing the Dialyzer: A Static Analysis Tool Detecting
Defects in Erlang Applications” Sagonas, 2005
“…testing, no matter how thorough, cannot of course detect all
software defects. Tools that complement testing, such as static analyzers, have their place in software development regardless of language.”
Conclusions
Types and Type Systems Are Really, Really Cool
Types Are A Prism
A Type System Can Be A Guide
Let’s Push It Forward
Thank You w michaelrbernste.in t @mrb_bk