Hacker News new | ask | show | jobs
by newgame 4347 days ago
Another, imho, more appealing Swift on Android is Kotlin http://kotlinlang.org/

It shares many features with Xtend but offers more. It has the opposite "problem" wrt IDE support though: Great IDEA support but no Eclipse support.

5 comments

I don't know how kotlin fares in practice for android, but I experimented with scala on android a few years back successfully.

The thing is, android doesn't really need a marketing blitz as big for alternative languages to be usable. dex converter did well enough on jvm bytecode.

I am building a side project app in Kotlin right now and so far it goes well. There are some minor problems with IDE support (kotlin source folder is not marked as a source folder when mixing Android and Kotlin together), but that is fixed with one click of a button. I really like it!
Kotlin for instance doesn't support something similar to active annotations aka compile-time macros. This is a very powerful concept. Here's an example of an annotation from the Xtendroid project (https://github.com/tobykurien/Xtendroid/blob/master/examples...)
Does it compile to Java source code?
According to the FAQ page, it compiles to Java bytecode.

Is it Java Compatible?

Yes. The compiler emits Java byte-code.

http://kotlin-web-site.jetbrains.org/docs/reference/faq.html

Does that violate the new ruling in favor of Oracle lately? If not, what if Oracle pursues that in the future, too? If I were Google I'd be like on needles about continuing to support Java on Android, and I'd start looking for a complete replacement (which will take years to come to fruition anyway, so all the more reason to start now).
I can't find any information right now, but I believe it statically compiles to Java bytecode, which means it can easily be dex'ed offline.

It wouldn't make sense to not support Android in a JVM language of 2014, honestly.

Kotlin looks amazing! I'm about to try it out.