Live data from Hacker News

Kotlin, the Swift of Android

blog.gouline.net

11–20 of 114 posts

Re: Kotlin, the Swift of Android

#11

You can write shared functionality in pure Ruby using RubyMotion then write your view layers for iOS and Android and have them each compiled correctly to native apps for each platform. I'd rather use Ruby than Swift or Kotlin.

Eventually you can write shared functionality in pure Ruby.

RubyMotion 3.0 for Android is still in the early beta phase and it probably won't be publicly available before the end of the year (it's not been announced, but I've seen the beta and that's my guess).

Re: Kotlin, the Swift of Android

#12
post #6
post #3

Scala for Android, https://news.ycombinator.com/item?id=8192406

I gave up trying to set it up for Android. It just sucks, and there is nothing but random blog entries on how to get it done. If someone pointed me to reliable resources on how to get it to work, I'd appreciate it very much (as I like the language itself)

Have you looked at the usage guides for the various plugins [1][2]?

[1] https://github.com/jberkel/android-plugin/wiki/getting-start... [2] https://github.com/pfn/android-sdk-plugin#usage

Re: Kotlin, the Swift of Android

#13

It would be nice if more of this was folded into Java itself, rather than existing as a new language - as the author notes a lot of it is in Java 8.

Java 8 does introduce a few features that are available in Kotlin, but AFAIK Java 8 won't be available for Android for some time. In addition, Kotlin makes a lot of constructs more succinct, including but not limited class definitions. So it's not only about what it adds, but what it "takes away" too IMHO.

Re: Kotlin, the Swift of Android

#14
post #9

Just a side question, the author mentions method count as a downside of introducing alternate JVM languages. Does the method could slowdown/bloat apps somehow?

It's way more fucked up than that, Dalvik is limited to 65k invocable methods per dex file: https://medium.com/@rotxed/dex-skys-the-limit-no-65k-methods... > You can reference a very large number of methods in a DEX file, but you can only invoke the first 65536, because that’s all the room you have in the method invocation instruction. > […] the limitation is on the number of methods referenced, not the number of met…

Is this limitation going away (or otherwise obviated) by ART?

Re: Kotlin, the Swift of Android

#15
It's an important point in Kotlin's favour that it's developed by JetBrain, the company that makes Google's official Android IDE.

If/when Google decides it's time to sanction a Java replacement on Android, the language designed by their tool provider seems like the obvious choice.

Re: Kotlin, the Swift of Android

#16

Just a side question, the author mentions method count as a downside of introducing alternate JVM languages. Does the method could slowdown/bloat apps somehow?

No, but older Android versions have a maximum 64000 method limit. I think it has been fixed for later versions, but I am really not sure. There have been some blog posts about Facebook's (controversial) attempts to work around this limit: https://www.facebook.com/notes/facebook-engineering/under-th...

Android 4.0 introduced a new set of Dalvik instructions that supported larger methods IDs, but they were never used and were eventually removed. ART may have lifted the method limit, but I haven't seen any specific mention of it.

Re: Kotlin, the Swift of Android

#17

Just a side question, the author mentions method count as a downside of introducing alternate JVM languages. Does the method could slowdown/bloat apps somehow?

No, but older Android versions have a maximum 64000 method limit. I think it has been fixed for later versions, but I am really not sure. There have been some blog posts about Facebook's (controversial) attempts to work around this limit: https://www.facebook.com/notes/facebook-engineering/under-th...

Not older. All. It's a limitation of the file format, not the runtime. It's a common misconception that it's fixed in later versions, because Facebook ran into a very similar (but different) problem that is fixed on newer devices (the one you linked to).

Re: Kotlin, the Swift of Android

#18
post #7

I have been fiddling with Kotlin for last few days. It is trivial to get it working in Android Studio, which is a plus already. It's not nearly as verbose as Java, and for one thing, it gives me LINQ that I've been missing from C#.

For C# devs, Xamarin is a good choice I believe, despite being paid.

Re: Kotlin, the Swift of Android

#19
post #15

It's an important point in Kotlin's favour that it's developed by JetBrain, the company that makes Google's official Android IDE. If/when Google decides it's time to sanction a Java replacement on Android, the language designed by their tool provider seems like the obvious choice.

It's not only about Android. Kotlin is one of the few languages that's developed hand in hand with IDE support. That means you've got Java-class IDEA support for the language, including (interestingly) a Java to Kotlin converter tool! It's not like many languages where you end up having to sacrifice all your nice refactoring tools and libraries to use it. For this reason alone Kotlin is a natural upgrade path for many Java shops.

Re: Kotlin, the Swift of Android

#20

You can write shared functionality in pure Ruby using RubyMotion then write your view layers for iOS and Android and have them each compiled correctly to native apps for each platform. I'd rather use Ruby than Swift or Kotlin.

> I'd rather use Ruby than Swift or Kotlin.

Yeah, but there are people who'd rather use Haskell, Clean, Agda or Idris. Kotlin, Swift, Rust and other such things seem like a reasonable middle ground from this perspective.

Post reply on HN