Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kotlin Nativeってandroid向けにもかけるんですよ

Kotlin Nativeってandroid向けにもかけるんですよ

RyuNen344

July 20, 2022
Tweet

More Decks by RyuNen344

Other Decks in Technology

Transcript

  1. Kotlin Nativeͱ͸ • αϙʔτ͍ͯ͠ΔPlatform • macOS, tvOS, watchOS • Linux

    • Windows(MinGW) • Android NDK Ref: https://kotlinlang.org/docs/native-overview.html
  2. Kotlin Nativeͱ͸ • Static or DynamicϥΠϒϥϦΛੜ੒Ͱ͖Δ • Static or Dynamic

    CϥΠϒϥϦΛऔΓࠐΊΔ • (Swift, Objective-CͷϑϨʔϜϫʔΫ΋औΓࠐΊΔ)
  3. Kotlin Native for Android Native • ݱঢ়API21͔Βαϙʔτ͞Ε͍ͯΔωΠςΟϒAPIʹରԠ͞Ε͍ͯΔ(ͬΆ͍) • ҎԼ͸Kotlin NativeΛ༻͍ͯKotlinͰ৮ΕΔ

    • jniपΓͷ͋Ε͜Ε༻ͷinterface • android native app API(Native ActivityͳͲ) • EGL(GLES1~3.1ؚΉ) • media • OpenMAX AL • posix(linuxίϚϯυྨ) • zlib Android NDKެࣜͷωΠςΟϒAPIҰཡ https://developer.android.com/ndk/guides/stable_apis?hl=ja
  4. ܕͷޓ׵ੑ(Primitive) KBWB KOJ $ $ PO,/ LPUMJOPO,/ CPPMFBO KCPPMFBO VJOU@U

    \MJCSBZ^@,#PPMFBO #PPMFBO CZUF KCZUF JOU@U \MJCSBZ^@,#ZUF #ZUF DIBS KDIBS VJOU@U \MJCSBZ^@,$IBS $IBS TIPSU KTIPSU JOU@U \MJCSBZ^@,4IPSU 4IPSU JOU KJOU JOU@U \MJCSBZ^@,*OU *OU MPOH KMPOH JOU@U \MJCSBZ^@,-POH -POH fl PBU K fl PBU fl PBU \MJCSBZ^@,'MPBU 'MPBU EPVCMF KEPVCMF EPVCMF \MJCSBZ^@,%PVCMF %PVCMF WPJE WPJE  \MJCSBZ^@,/BUJWF1US 
  5. ܭଌɿલఏ • Kotlin Nativeͷnew mm͸ෆ࢖༻ • Kotlin NativeͰ.soΛు͖ग़ͯͦ͠ΕΛndkʹऔΓࠐΜͰॲཧΛݺͼग़͢ • ࠓճ͸ΈΜͳେ޷͖ϑΟϘφονؔ਺Ͱܭଌ(Ұ൪Order਺ͷଟ͍࠶ؼ

    ύλʔϯ) • CoroutineͳͲΛ༻͍ͯॲཧதͷ࣮ߦεϨουͷมߋͳͲ͸ߦΘͳ͍ • tailrecΛ࢖ͬͨݴޠϨϕϧͷ࠷దԽ͸ߦΘͳ͍
  6. ܭଌɿ݁Ռ ߲਺a࣮૷NT LPUMJO $ ,/     

                                  
  7. ·ͱΊᶃ • ૉఢͳͱ͜Ζ • IDEࢧԉΛ͞Βʹड͚΍͍͢(CLion࣋ͬͯͳ͍ਓͰ΋Ϧονͳࢧԉ͕΋Β͑Δ) • ڧྗͳstdlibपΓΛઃఆͳ͠Ͱ࢖͑Δ • ίΞϩδοΫʹؔͯ͠͸׳ΕͯΔKotlinΛ࢖ͬͯهड़͢Δ͜ͱ͕Ͱ͖Δ •

    ͋ͱҰาͷͱ͜Ζ • Kotlin࢖ͬͯΔͷʹPointerΛҙ࣮ࣝͨ͠૷͕ՕॴՕॴͰൃੜ͢Δ • coroutine, atomicfu͕ରԠ͞Εͯͳ͍ରԠ͞ΕΔݟࠐΈ΋ͳ͍(͕ճආࡦࣗମ͸͋Δ) • ύϑΥʔϚϯεͦΜͳʹΑ͘ͳ͍ ૉͷ࣮૷ΑΓૣͯ͘ϏοΫϦ