https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Julius Hannink

02/12/2020, 12:46 PM
Hi everyone, I was wondering if it was possible to access kotlin code from a python environment without too much overhead in wrapping the stuff from the python side?! The application I am considering is an algorithm library in kotlin used in production for android / desktop / potentially iOS that our partners and us also want to use in research contexts where python is the weapon of choice. I saw this https://github.com/JetBrains/kotlin-native/tree/master/samples/python_extension but the wrapping stuff on the c-side seems too much overhead for now...Any thoughts?
k

Kris Wong

02/12/2020, 2:08 PM
well, you can compile bindings for C or JS. i don't have any idea what the interop story is for python
p

Patrick

02/12/2020, 5:01 PM
I think wrapping the sharedLib is the way to go. Just try to keep your interface to the Kotlin Code as small as possible.
j

Julius Hannink

02/14/2020, 11:53 AM
Jep, that's what we did with the predecessor in plain old Java. Turned out the interface to the java code was not so small after all 😉 I was hoping for a more write-once + reuse approach. Thanks 🙂
3 Views