Hacker News new | ask | show | jobs
by lmm 3146 days ago
> One thing I found out is that you really have to write a library in Java if you want it to be used in both Java and Kotlin. Java -> Kotlin is effectively one-way interop.

Hah. As someone who remembers the early days of Scala - the promise of seamless interop followed by the realisation that a language-idiomatic API requires much more than being able to seamlessly invoke a method - I can't say I'm surprised.

> One thing I did find out was that Kotlin is probably my favorite language. Very similar to Swift, though I wish you could re-open 3rd party classes to make them conform to additional interfaces which you can do with Swift protocols.

Maybe look at Scala; implicit conversions offer an easy-but-somewhat-hacky way to do that, while typeclasses are a very elegant general solution that a lot of libraries are based on these days.