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
Promises, Futures, and the Shape of Your Code
Search
Greg Heo
May 21, 2018
Technology
0
68
Promises, Futures, and the Shape of Your Code
Greg Heo
May 21, 2018
Tweet
Share
More Decks by Greg Heo
See All by Greg Heo
Concurrency From the Ground Up
gregheo
0
240
The least you need to know about hashing in Swift
gregheo
0
180
Shared Mutable State
gregheo
0
520
Shared, Exclusive, Mutable, Immutable
gregheo
0
150
Getting Under Swift’s Skin
gregheo
0
550
Sanitizing Threads for Fun & Profit
gregheo
0
160
Sanitizing All* The Things
gregheo
0
65
Thirteen Ways of Looking at a View Controller
gregheo
0
130
Five Unbelievable Secrets of Reactive Programming the Experts Don't Want You to Know!
gregheo
3
420
Other Decks in Technology
See All in Technology
君はジョシュアツリーを知っているか?名前をつけて事象を正しく認識しよう / Do you know Joshua Tree?
ykanoh
4
120
イベントで大活躍する電子ペーパー名札を作る(その2) 〜 M5PaperとM5PaperS3 〜 / IoTLT @ JLCPCB オープンハードカンファレンス
you
PRO
0
200
Kiro Meetup #7 Kiro アップデート (2025/12/15〜2026/3/20)
katzueno
2
240
Phase01_AI座学_基礎
overflowinc
0
3.6k
既存アプリの延命も,最新技術での新規開発も:WebSphereの最新情報
ktgrryt
0
160
ADK + Gemini Enterprise で 外部 API 連携エージェント作るなら OAuth の仕組みを理解しておこう
kaz1437
0
170
The Rise of Browser Automation: AI-Powered Web Interaction in 2026
marcthompson_seo
0
300
スピンアウト講座03_CLAUDE-MDとSKILL-MD
overflowinc
0
1.2k
Kiroで見直す開発プロセスとAI-DLC
k_adachi_01
0
130
中央集権型を脱却した話 分散型をやめて、連邦型にたどり着くまで
sansantech
PRO
1
330
SSoT(Single Source of Truth)で「壊して再生」する設計
kawauso
2
320
【PHPerKaigi2026】OpenTelemetry SDKを使ってPHPでAPMを自作する
fendo181
1
170
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
770
HDC tutorial
michielstock
1
580
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
200
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
990
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
390
How to Think Like a Performance Engineer
csswizardry
28
2.5k
How to make the Groovebox
asonas
2
2k
Are puppies a ranking factor?
jonoalderson
1
3.1k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Making Projects Easy
brettharned
120
6.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Paper Plane
katiecoart
PRO
0
48k
Transcript
@gregheo C1 Mobile Summit
++++++++[>++++[>++>+ ++>+++>+<<<<-]>+>+>- >>+[<]<-]>>.>---.+++ ++++..+++.>>.<-.<.++ +.------.--------.>> +.>++.
None
None
None
None
None
!
networker.beginRequest(.read, success: { data in })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in }
})
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in } } })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in } } } })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } }) print("Hello 1") print("Hello 2")
⏰#
None
A B C X Y Z
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } }) print("Hello 1") print("Hello 2")
⏰#
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } })
Clojure
Future
(defn square [x] (* x x) )
(defn square [x] (future (* x x)) )
(defn saveToDisk [data] (future ( ... )) )
saveToDisk future completed? cancelled? value
@myFuture (deref myFuture)
A X Y future B C D (deref future)
Future
Promise
@myPromise (deref myPromise)
getValue promise realized? value promise deliver
Promise
❓
%&