tink icon indicating copy to clipboard operation
tink copied to clipboard

Adding Kotlin Multiplatform support!

Open Syrou opened this issue 6 years ago • 2 comments

I would like to suggest you make support for kotlin multiplatform since you already support obj-c and java. It would be awesome to be able to use this with kotlin native and the multiplatform eco-system!

Syrou avatar Jan 24 '19 12:01 Syrou

Could be great to have this integrated into the roadmap at some point.

LouisCAD avatar Apr 03 '19 22:04 LouisCAD

Is there any progress on this? It shouldn't be too difficult as both Android and iOS are already supported.

ln-12 avatar Apr 20 '22 08:04 ln-12

We do not plan to offer a Kotlin implementation any time soon.

tholenst avatar Jan 26 '23 16:01 tholenst

Why?

LouisCAD avatar Jan 26 '23 23:01 LouisCAD

First, we simply do not have enough people to do this.

But secondly, one can easily use the Java API from Kotlin. Because of this, it is not obvious that having two implementations are actually useful. For example, imagine you have a codebase which is written in Java, and which uses Tink, and which you wish to migrate to Kotlin. You can do so with each file, but you will keep the Java version of Tink (since the Tink objects are method parameters in your code base and migrating one of them won't migrate them all).

In the end, if you come from this path, you anyhow end up having Java Tink objects in your Kotlin codebase. Migrating these to a completely different Tink implementation may not be worth the cost. At that point, you would find it most convenient if the APIs are the same anyhow.

Similarly, if you have a Kotlin codebase which uses Java Tink and a Kotlin codebase which uses Kotlin Tink, merging them would be more difficult than if both use Java Tink.

I think it would be better to simply migrate Tink to Kotlin if this is desired (but also, such a thing is very far out).

tholenst avatar Jan 27 '23 10:01 tholenst

More than providing an idiomatic Kotlin API, adding support for Kotlin Multiplatform would allow the Kotlin implementation to work on targets other than the JVM.

ashughes avatar Sep 30 '23 07:09 ashughes

OkHttp migrated to Kotlin without breaking the API for Java consumers, and probably using the Convert to Kotlin action from the IDE, either on a file, or directly on the entire source directory.

Maybe it can work out for tink. Did someone give it a try?

LouisCAD avatar Sep 30 '23 10:09 LouisCAD