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
5
2.9k
Know Your Types
GoRuCo 2014
Michael Bernstein
June 21, 2014
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.6k
Papers We Love NYC: "Propositions As Types" By Philip Wadler
mrb
1
1.7k
Compiling a Dependently Typed Language to Ruby
mrb
3
210
Programs That Eat Programs
mrb
2
1.3k
The Art of Obsession
mrb
3
810
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.9k
Other Decks in Technology
See All in Technology
工業高校で学習したとあるエンジニアのキャリアの話
shirayanagiryuji
0
110
【CEDEC2025】『Shadowverse: Worlds Beyond』二度目のDCG開発でゲームをリデザインする~遊びやすさと競技性の両立~
cygames
PRO
1
370
20250807_Kiroと私の反省会
riz3f7
0
240
LLMで構造化出力の成功率をグンと上げる方法
keisuketakiguchi
0
910
AI時代の大規模データ活用とセキュリティ戦略
ken5scal
0
150
o11yツールを乗り換えた話
tak0x00
2
1.5k
生成AIによるデータサイエンスの変革
taka_aki
0
3k
生成AI導入の効果を最大化する データ活用戦略
ham0215
0
160
Lambda management with ecspresso and Terraform
ijin
2
170
LLMをツールからプラットフォームへ〜Ai Workforceの戦略〜 #BetAIDay
layerx
PRO
1
1k
結局QUICで通信は速くなるの?
kota_yata
8
7.3k
ユーザー課題を愛し抜く――AI時代のPdM価値
kakehashi
PRO
1
120
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
RailsConf 2023
tenderlove
30
1.2k
Fireside Chat
paigeccino
38
3.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Testing 201, or: Great Expectations
jmmastey
45
7.6k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Done Done
chrislema
185
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.4k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
20k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.3k
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