4 ms·
You mean Kotlin <-> Java or Kotlin <-> C? Kotlin Native (Kotlin <-> C & Objective C) just came out this month, is still a technology preview, and AFAIK is real
by nostrademons 10y ago
You mean Kotlin <-> Java or Kotlin <-> C?
Kotlin Native (Kotlin <-> C & Objective C) just came out this month, is still a technology preview, and AFAIK is really rough around the edges. Haven't tried it.
Kotlin has always had a very good Java interop story, in both directions. I've been using it for a year with Hadoop, AWS, JSoup, Rome, Jackson, DropWizard, Jetty, Apache Commons, ElasticSearch, Weka, and many other standard Java libraries and never had a problem. You basically drop in a library and go. Several of those libraries are either really old (eg. Weka was written in the last millenium) or pretty complex (Jackson is all annotation/reflection based), and I've never really had a problem. You do need to keep track of nulls yourself when crossing the Java boundary, and you need to understand what code Kotlin generates if you're implementing an interface or placing annotations, but both of those are well-documented and pretty typical tasks for any FFI work.
- swah 10y agoDid you choose to work with the JVM since leaving G?
- nostrademons 9y agoYeah, for this project at least. I've found that my choice of technology stack is largely dictated by a.) the libraries that are available and b.) the potential market I'm investigating. It's in Kotlin because I need Hadoop for at least part of the project, and one corpus I'm working with has a bunch of supporting tools in Java that aren't available on other platforms. I'd been doing a bunch with smartwatches a year or two back, so the project before this was in Swift (because when I talked to potential customers & looked at market share numbers, starting with anything other than the Apple Watch was indefensible), and two projects before then were in Java (because the Apple Watch wasn't out yet and Android Wear & Pebble were the only games in town). There were also a couple ideas that I'd tested out using just WordPress and YouTube, with no coding at all.