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.8k
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
0
4.4k
Papers We Love NYC: "Propositions As Types" By Philip Wadler
mrb
1
1.6k
Compiling a Dependently Typed Language to Ruby
mrb
3
190
Programs That Eat Programs
mrb
2
1.3k
The Art of Obsession
mrb
3
770
The Research Omphalos
mrb
1
250
Papers We Love: "A Unified Theory of Garbage Collection"
mrb
4
2.2k
Distributed Systems Archaeology
mrb
22
3k
GoRuCo 2013
mrb
11
4.7k
Other Decks in Technology
See All in Technology
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
非機能品質を作り込むための実践アーキテクチャ
knih
3
980
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
170
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
26
11k
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
440
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
20241220_S3 tablesの使い方を検証してみた
handy
3
360
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Designing for humans not robots
tammielis
250
25k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Gamification - CAS2011
davidbonilla
80
5.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Writing Fast Ruby
sferik
628
61k
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