Hacker News new | ask | show | jobs
by tipsy- 3147 days ago
It's not that much more work. You have to be careful with a few concepts (like SAM/Functional interfaces), but most of the time you can just write in Kotlin. I want to support both because a lot of companies are probably like the one I work for, where there are a lot of java-devs, and a few of them are pushing for kotlin. This seems like a good compromise to me.

Play was two different projects tho? There is only one Javalin source.

1 comments

There is only one for play as well
Okay, poorly worded. I think (please correct me if I'm wrong) that in play you have distinct parts of the code-base that are for Java developers, while other parts are for Scala developers.

In Javalin, although some parts are written in Kotlin and some parts are written in Java, there is 0 duplication. If one part is written in Kotlin, both Java and Kotlin developers use that part. If a part is written in Java, both Java and Kotlin developers use that part.

That is correct. There are 2 separate APIs (that come from a single project). This is because Scala can support a bunch of functionality that Java (and Kotlin) can't support (type classes, higher kinded types, etc.). So your options are to hamstring the API for Scala or have 2 separate APIs.