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
Extending kotlinx.serialization functionality w...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Karin-Aleksandra Monoid
June 08, 2022
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Extending kotlinx.serialization functionality with Arrow Meta (Joker 2021/KotlinDevDay 2022)
Karin-Aleksandra Monoid
June 08, 2022
More Decks by Karin-Aleksandra Monoid
See All by Karin-Aleksandra Monoid
Treasure.map(): Functional programming in JVM-based languages
paranoidmonoid
0
340
Extending kotlinx.serialization functionality with Arrow Meta
paranoidmonoid
0
130
Functional Kotlin with Arrow (jLove 2021)
paranoidmonoid
1
240
Hands-on Arrow
paranoidmonoid
1
170
Make Tech Slides Work
paranoidmonoid
0
620
"Fun" as in "funeral": full-stack development using Kotlin JS
paranoidmonoid
0
130
Other Decks in Programming
See All in Programming
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
200
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
130
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
120
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
180
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
210
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
540
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
370
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
520
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.8k
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
180
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.6k
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.5k
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
360
Typedesign – Prime Four
hannesfritz
42
3.1k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
650
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
290
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
390
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
440
Agile that works and the tools we love
rasmusluckow
331
22k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
Transcript
1 Extending kotlinx.serialization functionality with Arrow Meta Karin-Aleksandra Monoid Kotlin
Dev Day 2022
2 • Senior Software Engineer at CircleCI • Background in
Kotlin & Scala (both front and backend) • Living in Germany with two cats • GDE in Kotlin About
3 • Senior Software Engineer at CircleCI • Background in
Kotlin & Scala (both front and backend) • Living in Germany with two cats • GDE in Kotlin About
4 Agenda Why? What is Arrow Meta? Sample project Showtime!
5 Project Stack • Just backend with Ktor + Arrow
• Jackson was kind of "default" • Smooth but not Kotlin-first
6 kotlinx.serialization – pros 🚀 • Kotlin-first • No boilerplate
for sealed classes
7 kotlinx.serialization – cons • Not a lot of serializers
out of the box • No global naming strategy
8 Global Naming Strategy UPPER_SNAKE_CASE -> camelCase USER_NAME -> userName
9 Jackson: Object Mapper val objectMapperUpperSnakeCase = jacksonObjectMapper().apply { propertyNamingStrategy
= PropertyNamingStrategies.UPPER_SNAKE_CASE }
10 Issue #33 https://github.com/Kotlin/kotlinx.serialization/issues/33
11 Global Naming Strategy @SerialName("USER_NAME") val userName: String
12 What is Arrow Meta?
13 “Functional companion to Kotlin's Compiler” What is Arrow Meta?
Image source: https://arrow-kt.io/
14 GIF source: https://github.com/arrow-kt/arrow-meta
15 • Already using other part of Arrow for FP
Why Arrow Meta?
16 Why Arrow Meta? • More functionality than KSP/KAPT •
Easier than kotlinc
17 Sample Project
18 https://bit.ly/3C2lHGp Link to repo
19 • various animals (actually, only cats and dogs) •
various sources (= 3rd party services) • various standards of documentation (in JSON format with different naming policies) Setting: a Zoo
20 Live coding time
21 • It works • ??? • Requires more knowledge
than expected • KSP is preferable if it fits Thoughts
22 Resources • https://meta.arrow-kt.io/ • https://github.com/arrow-kt/arrow-meta-examples • https://paranoidmonoid.github.io/articles/Kotlin%20and%20frien ds/Naming%20strategy%20plugin