Experiences with Kotlin/JS?

162 views
Skip to first unread message

ji...@jinq.org

unread,
Jul 13, 2023, 9:37:22 PM7/13/23
to GWT Users
I'm a long-time GWT user, but I've recently been tempted by the siren songs of Kotlin/JS. Does anyone have any experience with it? Is it worth migrating to?

How large is its JS output compared to GWT? Is the code output reliable and mature? How is the debugging? How is the JS interop? I've read that there might be semi-automated methods of converting Java code to Kotlin--how have people found that? I don't use many of the GWT libraries, so I can easily rework that aspect of the code. Can I stay with Eclipse-Maven or will I have to move to IntelliJ-Gradle? 

Every time I look at J2CL, it just seems like it went too deep down the Google rabbit-hole and is completely divorced from modern JavaScript practices, so I've been curious about other possible future migration paths for my GWT code.

Craig Mitchell

unread,
Jul 15, 2023, 8:30:38 PM7/15/23
to GWT Users
Also would like to hear from someone with some deep experience with it for a good comparison.  However, my 2 cents from what I've seen...

Good integration and you get the basics of Kotlin to JS compilation, plus easy to use JavaScript interoperability.

You need to include a 1.3Mb kotlin.js library file with your project which isn't ideal.  And if you want to use extra features, like the kotlin html-js lib, you also need to add those, which further increases the JS download size.

Probably a good choice for connecting a Kotlin project to a JS project, or if you just need some simple JS for your Kotlin project.  If you needed more features, GWT would be a better choice (with its UIBinder, RPC, ...).

I agree with your comments about J2CL.

Personally, I'm more excited about Java to WASM compilations that will hopefully be more supported now WASM is getting garbage collection.

Reply all
Reply to author
Forward
0 new messages