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
Context Receiversに思いを馳せる / Context Receivers
Search
uzzu
October 05, 2022
Technology
0
560
Context Receiversに思いを馳せる / Context Receivers
DroidKaigi2022 Dialogs - 2022/10/05 14:20-14:45
https://droidkaigi.jp/2022/timetable/363729
uzzu
October 05, 2022
Tweet
Share
More Decks by uzzu
See All by uzzu
StoreKitのこれまでとこれから / StoreKit 2 from 1
uzzu
5
9.3k
Autofill Framework
uzzu
0
83
アプリ内課金の最新事情 クライアントサイド編 / In-app Purchase in Cookpad 2019
uzzu
3
4.2k
Billing Client 2.0 acknowledgement
uzzu
0
16k
Promoting IAP対応から学ぶ外部アプリ内課金実装 / Promoting IAP and others
uzzu
2
1.3k
ブログ作り直した / My blog @ Othlo Tech
uzzu
0
110
新規アプリ開発を支えるユーザ・決済基盤
uzzu
2
2.5k
kotlin-mpp-library-tips
uzzu
1
6.1k
Coroutine Kyuin
uzzu
2
260
Other Decks in Technology
See All in Technology
Eventual Detection Engineering
ken5scal
0
930
Oracle Database 23ai 新機能 #3 Oracle Globally Distributed Database(GDD)
oracle4engineer
PRO
1
170
強いチームを夢見て-PMからSREに転身して1年の振り返り / 20240906_bengo4_sre
bengo4com
2
800
四国のあのイベントの〇〇システムを45日間で構築した話 / cloudohenro2024_tachibana
biatunky
0
260
【Λ(らむだ)最近のアプデ情報 / RPALT20240904
lambda
0
170
SAVEPOINT α版
savepoint
0
370
突撃! 隣のAmazon Bedrockユーザー 〜YouはどうしてAWSで?〜
minorun365
PRO
2
180
標準最高!標準はださくないぞ! at fukuoka.ts #1
yoiwamoto
0
150
LLMに日本語テキストを学習させる意義
ksaito
13
3.6k
2024年版 運用者たちのLLM
nwiizo
3
400
Dive Deep in Cloud Run: Automatic Base Image update
aoto
PRO
0
900
自社開発した大規模言語モデルをどうプロダクションに乗せて運用していくか〜インフラ編〜
pfn
PRO
4
1.1k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
354
29k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.8k
Pencils Down: Stop Designing & Start Developing
hursman
118
11k
The Cult of Friendly URLs
andyhume
76
5.9k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
For a Future-Friendly Web
brad_frost
174
9.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.9k
Music & Morning Musume
bryan
46
6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
123
18k
Typedesign – Prime Four
hannesfritz
39
2.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
Transcript
Context Receiversʹ ࢥ͍ΛͤΔ uzzu @ 2022/10/05 DroidKaigi 2022 DAY.01
Cluster, Inc. All Rights Reserved. 2 ҙ 2022/09࣌Ͱͷ ใΛݩʹൃද͓ͯ͠Γ·͢ ࢥ͍ΛͤΔ༰ͳͷͰओ؍ؚ·Ε͓ͯΓ·͢
Context Receiversݱࡏprototypeஈ֊Ͱ͢ ྃ͝ঝ͍ͩ͘͞
Cluster, Inc. All Rights Reserved. 3 ࣗݾհ @uzzu Cluster, Inc.
ιϑτΣΞΤϯδχΞ झຯ: VR, ࡶଟͳٕज़ݕূ, ಡॻ, DTM, ֨ήʔ, εϓϥ
Cluster, Inc. All Rights Reserved. 4 ClusterͷAndroidΞϓϦʹ͍ͭͯ AndroidΞϓϦ ࠾༻ใ AndroidΞϓϦΤϯδχΞืू
⬆ inroom (Unity as a Library) ⬅︎ outroom (Native App)ɹɹɹ
Cluster, Inc. All Rights Reserved. 5 ΞδΣϯμ ɾContext Receivers͕དྷΔ·Ͱͷ͓͞Β͍ ɾContext
Receiversͱɺ༻ྫ ɾContext Receiversͷ՝ɺࢥ͍ ɾ·ͱΊ
Cluster, Inc. All Rights Reserved. 6 ContextReceivers͕དྷΔ·Ͱͷ͓͞Β͍ KEEP(https://github.com/Kotlin/KEEP) YouTrack(https://youtrack.jetbrains.com/) Kotlin
Slack(https://kotlinlang.slack.com/) ͍͔ͭ͋͘Δ͕ͦͷதͰ2ͭͷissueΛൈਮ
Cluster, Inc. All Rights Reserved. 7 Compile-time Extension Interfaces https://github.com/Kotlin/KEEP/pull/87
2017/10ࠒ ɾ࠷ॳظʮType Classesʯͱ͍͏λΠτϧͰproposal͕ॻ͔Ε͍ͯͨ ɾʮ͍ͭʹKotlinʹܕΫϥε͕དྷΔ…?!ʯͱ͍͏ࣄͰք۾Γ্͕Δ
Cluster, Inc. All Rights Reserved. 8 Compile-time Extension Interfaces https://github.com/Kotlin/KEEP/pull/87
Cluster, Inc. All Rights Reserved. 9 Compile-time Extension Interfaces https://github.com/Kotlin/KEEP/pull/87
ɾcompanion objectͱͷׂͷॏෳ ɾJVMͱͷ૬ޓӡ༻ ɾෳͷϨγʔόʹର͢Δ֦ுߏจ͕ඞཁ ɾimplicit parameterͷ͠͞ ɾetc…
Cluster, Inc. All Rights Reserved. 10 Multiple receivers on extension
functions/properties https://youtrack.jetbrains.com/issue/KT-10468 https://youtrack.jetbrains.com/issue/KT-42435
Cluster, Inc. All Rights Reserved. 11 ͦͯ͠Context Receivers https://github.com/Kotlin/KEEP/issues/259 https://github.com/Kotlin/KEEP/blob/master/proposals/context-
receivers.md ឯ༨ۂંʹ͍ͭͯProposalʹॻ͔Ε͍ͯΔ (Alternative approaches and design tradeoffs) 1.6.20-M1 ʹͯPrototypeͱͯ͠ϦϦʔε https://blog.jetbrains.com/kotlin/2022/02/kotlin-1-6-20-m1- released/ freeCompilerArgs = listOf("-Xcontext-receivers")
Cluster, Inc. All Rights Reserved. 12 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ) ɾίϯςΩετநԽΛهड़͢ΔͨΊͷ
ɹmember extension(ϝϯόʔ֦ு)ΛऔΓআ͘
Cluster, Inc. All Rights Reserved. 13 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ)
Cluster, Inc. All Rights Reserved. 14 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ)
Cluster, Inc. All Rights Reserved. 15 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ)
Cluster, Inc. All Rights Reserved. 16 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ) ɾKotlinͷܕγεςϜͰෳͷϨγʔόΛ࣋ͭ
ɹίʔυϒϩοΫΛදݱͰ͖ΔΑ͏ʹ͢Δ
Cluster, Inc. All Rights Reserved. 17 Context Receiversͷͦͷଞͷྫ ɾίϯετϥΫλͷӅṭ +
Contextࢀর
Cluster, Inc. All Rights Reserved. 18 Context Receiversͷͦͷଞͷྫ ɾOverloading(※ҙ͋Γ) ͜͏͍͏ίʔυॻ͔ͳ͍Ͱɺͳ༰Proposalʹهࡌ͞Ε͍ͯΔ
(contexts-and-coding-style)
Cluster, Inc. All Rights Reserved. 19 ɾContext Functionͷείʔϓ֊ͷਂ͞(ݕ౼த) ɾReflectionະରԠ(Prototypeஈ֊ͰΒͳͦ͏ͳؾ͕) ɾΤοδέʔεͷରԠ
(Kotlin 1.8.0ͰҰ෦मਖ਼ࡁ) ɾSyntax Highlighting(Τϥʔు͘ͷͰےͰ) ɾetc… Context Receiversͷ՝(Future Work)
Cluster, Inc. All Rights Reserved. 20 (ϓϩτλΠϓஈ֊Ͱͱ͔͍͘͏͖ Ͱͳ͍ͷঝͰ) ɾهड़ͷબࢶ͕ଟͯ͋͘Μ·Γࠓ·ͰͷKotlinΒ͘͠ͳ͍Α͏ͳؾ͕͢Δͷ͕ ɹݸਓతʹٯʹ໘ന͍
ɾCompile-time extensionํ໘Ͱ্͕ͬͨ՝͔ΒݟΔʹՄೳͳهड़ ɹ͜Ε͔ΒߜΒΕ͍ͯͬͯཉ͍͠ͳʔͱࢥ͍ͬͯΔ ɹ(ཞ༻͕ාͯ͘ਂ͘৮Εͳ͍ਓʑ͕͍ͦ͏ͳͷ͍ͬͨͳ͍ɺͱ͍͏ҙຯͰ) ɾݱঢ়Ͱᙱ͍ͱ͜Ζʹख͕ಧ͘ͷͰݸਓతʹॿ͔Δ Context Receiversͷࢥ͍
Cluster, Inc. All Rights Reserved. 21 Context Receiversͷࢥ͍ ɾͦͦͳͥ ”Context”
ʹͳͬͨͷ͔…ʁ ɹ=> Multiple receiversͷϓϩτλΠϓͷஈ֊Ͱ ɹɹύϥϝʔλΛஔ͖͑ΔͨΊʹ͋ΔΘ͚Ͱͳ͘ ɹɹؔݺͼग़͠ͷͨΊͷίϯςΩετΛՃ͢Δҝͷ ɹɹઃܭ͕ඞཁͩͱؾ͍ͮͨҝ ɹɹ=> ύϥϝʔλͷΘΓʹ༻͢Δ߹ʹ ɹɹɹهड़͕ʹͳΔΑ͏͍͑ͯͯ͠Δ ɹɹɹ=> ཞ༻͞Εͳ͍Α͏ʹ https://youtrack.jetbrains.com/issue/KT-10468/Multiple-receivers-on-extension-functionsproperties#focus=Comments-27-4608759.0-0
Cluster, Inc. All Rights Reserved. 22 Context Receiversͷࢥ͍ ɾͦͦͳͥ ”Context”
ʹͳͬͨͷ͔…ʁ ɹ=> Multiple receiversͷϓϩτλΠϓͷஈ֊Ͱ ɹɹύϥϝʔλΛஔ͖͑ΔͨΊʹ͋ΔΘ͚Ͱͳ͘ ɹɹؔݺͼग़͠ͷͨΊͷίϯςΩετΛՃ͢Δҝͷ ɹɹઃܭ͕ඞཁͩͱؾ͍ͮͨҝ ɹɹ=> ύϥϝʔλͷΘΓʹ༻͢Δ߹ʹ ɹɹɹهड़͕ʹͳΔΑ͏͍͑ͯͯ͠Δ ɹɹɹ=> ཞ༻͞Εͳ͍Α͏ʹ https://youtrack.jetbrains.com/issue/KT-10468/Multiple-receivers-on-extension-functionsproperties#focus=Comments-27-4608759.0-0 ͻΐͬͱͯ͠ਅ໘ʹimplicit parameterʹcode generationͳΓͰ ͪΌΜͱରԠͰ͖ΔΑ͏ʹɺ༨നͱ͍ͯͯ͠͠ΔͷͩΖ͏͔…ʁ ؾʹͳΔ…ͦΘͦΘ…ৄ͍͠ਓڭ͍͑ͯͩ͘͞
Cluster, Inc. All Rights Reserved. 23 ·ͱΊ ɾContext ReceiversܕΫϥεͷProposal͔Β
ɹෳͷϨγʔόʹର͢Δ֦ுߏจ͕ඞཁͱ͍͏ ɹྲྀΕͰ࡞ΒΕͨ ɾKotlinʹͯࣗ͘͠͠༝ͷߴ͍Proposal ɾָ͍͠ͷࠓ͚͔ͩ…ʁ ɹProposalΛಡΜͰָ͘͠ɹ ʂ
Context Receiversʹ ࢥ͍ΛͤΔ uzzu @ 2022/10/05 DroidKaigi 2022 DAY.01