# GSOC 20, Support for Kotlin Native

**URL:** <https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474>\
**Category:** Summer of Code\
**Created:** [March 7, 2020, 5:38am UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474 "2020-03-07T05:38:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdityaRana](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/adityarana/32/18501_2.png) [@AdityaRana](https://discourse.processing.org/u/AdityaRana)\
**Post date:** [March 7, 2020, 5:38am UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/1 "2020-03-07T05:38:05Z")

</div>

Hi to community ,  
I am **Aditya Rana** , undergrad student at **National Institute of Technology ,Trichy ,India**. Currently pursuing BTech 2nd year with Major in Instrumnentation and Control Engineering and Minor in Computer Science Engineering. I am proficient in android application development ,java ,kotlin ,golang ,python. As i have already good experience in kotlin and have published few apps powered by kotlin on [Google Playstore](https://play.google.com/store/apps/developer?id=DeltaForce&hl=en) .  
**I would love to contribute in Processing -Android to the -“Support for Kotlin Native” as this matches my skills best.**

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [March 7, 2020, 5:25pm UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/2 "2020-03-07T17:25:31Z")

</div>

You can start by exploring previous posts related to Kotlin in the forum. I found two posts that are relevant:

- [Writing Processing in Kotlin](https://discourse.processing.org/t/writing-processing-in-kotlin/3957)
- [New Idea: Swift Playgrounds Mode for Processing](https://discourse.processing.org/t/new-idea-swift-playgrounds-mode-for-processing/10021/3)

My suggestion to prepare to GSoC? Become familiar with the PDE, learn how the PDE manages modes, how does java and android mode works and then explore what is needed to support Kotlin. Get involved here with the community by helping users and learning current use cases. Finally, [this wiki doc](https://github.com/processing/processing-android/wiki) might come handy to get started with Processing android.

Kf

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [March 7, 2020, 5:42pm UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/3 "2020-03-07T17:42:26Z")

</div>

Maybe you would like contact or work with [this user](https://discourse.processing.org/t/getting-started-with-gsoc-for-processing-android/18114)

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [March 7, 2020, 5:47pm UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/4 "2020-03-07T17:47:40Z")

</div>

Please keep all conversations in the forum so other ppl can pitch in. @Andres is the Processing Android owner FYI. @sarahlensing has an oversight of Kotlin Native and their input (plus other Processing contributors and users) will be useful to drive this discussion forward.

Kf

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [March 7, 2020, 6:59pm UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/5 "2020-03-07T18:59:21Z")

</div>

@codeanticode at [Github](https://github.com/processing/processing-android/graphs/contributors) is the main contributor

---

<div class="post-metadata">

**Author:** ![AdityaRana](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/adityarana/32/18501_2.png) [@AdityaRana](https://discourse.processing.org/u/AdityaRana)\
**Post date:** [March 9, 2020, 6:48pm UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/6 "2020-03-09T18:48:24Z")

</div>

@kfrajer@noel thanks for the reply , these were the good starting points for project . I went through these posts and all related posts and learn about the kotlin Native and trying to make a small multiplatform app using kotlin Native [here](https://github.com/ranaaditya/Multiplatform-app) .

Thanks @Andres and @sarahlensing for such a wonderful project. I think that possibility of using the Kotlin Native to run Processing sketches on both iOS and Android is really promising and through this our project will be able to use the advanced functionality that kotlin has and ios graphics will also be boost using processing.

Thanks ,  
Aditya Rana

---

<div class="post-metadata">

**Author:** ![anoniim](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/anoniim/32/12009_2.png) [@anoniim](https://discourse.processing.org/u/anoniim)\
**Post date:** [May 31, 2020, 7:56am UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/7 "2020-05-31T07:56:10Z")

</div>

Kotlin has a big potential to allow people writing processing code that can be run on virtually any platform.

I’ve created an interface that unified Java and Android implementations (with limited functionality) but learning about Kotlin Multiplatform made me reconsider and I’m currently looking to create a Kotlin project that would compile sketches into Android, Java and JavaScript. I picked these because Processing core libraries are available for these platforms. Compiling into native code for iOS or other platforms would be icing on the cake!

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [May 31, 2020, 8:43am UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/8 "2020-05-31T08:43:54Z")

</div>

> [@anoniim](#):
>
> I’ve created an interface that unified Java and Android implementations

Hi @anoniim , welcome to the forum.  
I am looking forward to see it. Is a preview available?

---

<div class="post-metadata">

**Author:** ![anoniim](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/anoniim/32/12009_2.png) [@anoniim](https://discourse.processing.org/u/anoniim)\
**Post date:** [May 31, 2020, 9:38am UTC](https://discourse.processing.org/t/gsoc-20-support-for-kotlin-native/18474/9 "2020-05-31T09:38:38Z")

</div>

Thanks @noel 🙂  
I discontinued the work on Android + Java interface. Although a good idea, my original design didn’t execute it very well.

It’s not documented but you can check [where I was going with it](https://github.com/anoniim/visuals/blob/master/library/src/main/kotlin/net/solvetheriddle/processing/library/GenericApplet.kt).  
Ignore the second part of the file after `/* Custom fields */`. The important bit is `GenericApplet` that abstracts the platform-specific `PApplet` classes and `Applet` interface that has [Android](https://github.com/anoniim/visuals/blob/master/androidApp/src/main/java/net/solvetheriddle/processing/android/AndroidApplet.kt) and [Java](https://github.com/anoniim/visuals/blob/master/javaApp/src/main/java/net/solvetheriddle/processing/java/JavaApplet.kt) implementation to provide two-way communication. All I had to do then is [implement the GenericApplet](https://github.com/anoniim/visuals/blob/master/library/src/main/kotlin/net/solvetheriddle/processing/library/sketches/PolygonSpiral.kt) and I was able to compile to both Android and Java.

Quite feasible at the first glance but I hit a roadblock when trying to work with images. I would have to abstract `PImage` (and pretty much every other library class) in this tedious way. That’s where Kotlin Multiplatform might work better because it has multiplatform class declarations that could be implemented directly by the library classes.

The biggest worries are interface inconsistencies and the difference between various Processing library implementations which would result in a different behvior on some platforms.
