Live data from Hacker News

Android now supports Kotlin

venturebeat.com

201–210 of 225 posts

Re: Android now supports Kotlin

#201
post #180

Earlier quoted context omitted.

That's a pretty absurd claim, their native implementation is not only experimental, the GC solution is "unknown". You can't make this stuff up, it will be years before anyone is writing production IOS apps in Kotlin. Heck, their JS implementation still generates massive binaries. Targeting the JVM/Android? Sure, good to go; otherwise the promised land is a long way off.

"Unknown"? They have said from the beginning that it uses reference counting with cycle collection, for example in RELEASE_NOTES.md: "Currently Kotlin/Native uses reference counting based memory management scheme with a cycle collection algorithm. Multiple threads could be used, but no objects shared between threads are allowed." They have also said that it's pluggable and they might experiment with other collectors…

The point is that the claim of cross platform everything is wildly unrealistic at this time. JVM/Android is production ready; javascript, getting there; native, not even close.

I don't doubt that 2-3 years from now Kotlin will have a cross platform solution, but to claim so today is borderline delusional. It's understandable that users are excited, Kotlin's on the verge of bigger things, perhaps even mainstream level adoption if everything falls into place, but there's a ways to go before they achieve one-language-to-rule-them-all.

Re: Android now supports Kotlin

#202
post #94

Earlier quoted context omitted.

Kotlin was released on 15 February 2016.[0] [0] https://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-release...

It went 1.0 last year. It was in development for 5 years, and some people did adopt it for Android development before 1.0 https://en.wikipedia.org/wiki/Kotlin_(programming_language) Anyway, that's my point. Apple iterated Swift quickly in 3 years, and Swift is a very nice language now. Some sort of support, or even acknowledgement, from Google could have accelerated Kotlin.

Given that most developers still complain about the state of Swift and its tooling I'm not sure Google's approach is wrong here. Most serious Android developers have been aware about Kotlin for a while, and today it's mature enough to be openly endorsed by Google.

Re: Android now supports Kotlin

#203

I've avoided writing React Native modules in Swift because I don't want to add the Swift runtime. It would make my app a lot bigger, and while I love Swift, I'm fine writing a few lines of code in ObjC. Will Kotlin add any extra data to an Android app? Does it have it's own runtime, or does it just compile down to the same bytecode as Java? If the app size is equivalent to Java, then this is amazing. I love Kotlin, a…

Rewriting React Native with Kotlin would make a lot of sense. Kotlin compiles to Java bytecode, so you don't need to deal with JavaScript engines, serialization/deserialization, etc. Kotlin will compile to machine code, so it'll be supported with iOS with the same advantages. Kotlin performance is better than JavaScript. Kotlin has async constructions, etc. Kotlin could be compiled to JavaScript for web apps, so code reuse will work.

The only thing that Kotlin misses is XML Tags inside the language, but they could be modeled with DSL API.

That said, I don't think that Facebook would rewrite react native. It's an impossible task and they don't really need it. But I hope that some big player will replicate react native with Kotlin.

Re: Android now supports Kotlin

#204
post #6

If you have used kotlin, it seems the obvious move. I am not coming back to java, unless completely necessary. Kotlin is a great language (and more fun!).

Out of interest, what is wrong with Java? I found writing Android apps easy enough using Java. I am from a C++ background, so find all the C# and Java that I have to write quite simple, so I'd be intrigued to know what was "wrong" with Java. Is it worth me looking into Kotlin? I am already halfway through investigating Swift so it seems the endless task of keeping up to date with new languages for each platform (keep…

There's nothing wrong with Java. It's outdated language by today's standards, a lot of code which takes 100 lines in Java would take 50 lines in Kotlin (and if we'll take autogenerated boilerplate getters/setters, it could be 1000->50), but overall Java is fine.

But I still suggest you to look into Kotlin. If you know Java, you won't spend much time learning it and with awesome IDE support you can be productive in very short time. You might find that you'll just prefer Kotlin over Java for a lot of little things which makes coding more enjoyable.

Re: Android now supports Kotlin

#205
post #94

Earlier quoted context omitted.

It went 1.0 last year. It was in development for 5 years, and some people did adopt it for Android development before 1.0 https://en.wikipedia.org/wiki/Kotlin_(programming_language) Anyway, that's my point. Apple iterated Swift quickly in 3 years, and Swift is a very nice language now. Some sort of support, or even acknowledgement, from Google could have accelerated Kotlin.

Given that most developers still complain about the state of Swift and its tooling I'm not sure Google's approach is wrong here. Most serious Android developers have been aware about Kotlin for a while, and today it's mature enough to be openly endorsed by Google.

Right. Swift might be done in version 4.0. Or even 5.0. No ABI stability for example so you're always shipping up to 10MB of Swift runtimes with your app, which is still a considered a lot for a mobile app unless you work at Facebook. The constant IDE crashes are gone luckily but sometimes compiling gets reaaallllyyyy slllooowwwwww all of a sudden just when your product hits a certain critical complexity.

Seems that automatic type inference is something that's really nice for one page programs but explodes in complexity for the compiler once you start to do it in big programs with complex structures (nested dictionaries) or methods (like chaining flatMap with filter with join).

I'm trying to work with R.Swift and IBAnalyzer nowadays to have a 100% "if it compiles it doesn't crash" solution even while using Storyboards and that alone increases my productivity more than any left over annoyances at the moment might decrease.

Swift 1.x was horrible though. I had to pick up a project left half finished by a junior to finish it. What a nightmare. Every new Xcode point release broke everything

Re: Android now supports Kotlin

#206
post #121

Earlier quoted context omitted.

That has no value for Google. If Google wanted to get rid of JVM technology and idioms on Android then it would be better off with pure native language like Swift/Rust/Go. They all are quite further away from Javaism. Kotlin's great value is mostly because it is Java like and run on JVM.

Kotlin supports automated conversion of Java into Kotlin code. This means you could quickly transform any existing app into a Kotlin Native app quickly.

Exactly, this sounds like just the right move to me if you're Google and would like to see a nice transition period out of the Java dependency, but until then, also support JVM. I'm sure such a move wouldn't come abruptly. Would be cool if they could get that strategic move and a more fun/productive language than Java in the same bang.

Re: Android now supports Kotlin

#207
post #71

Earlier quoted context omitted.

I have nothing against Kotlin. It seems to be coming out of nowhere to surpass more "tested" languages for lack of a better way of putting it, but as I'm reading about it I can truly see the appeal. The one thing I'm having trouble figuring out, though, is how much it diverges from Java in terms of inheritance, traits, etc. The verbosity of Java is one thing, but its inheritance system is what made me want to pull my…

Kotlin didn't change, the only difference is `trait` keyword replaced with `interface` keyword. But I'm not really getting this article. Inheritance is key principle of Object-Oriented Programming, throwing it away would be very stupid move. It could be abused, but everything could. Kotlin solves this in pragmatic way: if you need inheritance, you must declare it explicitly. If you want delegation, Kotlin got you cov…

No , inhertiance is not a key part of oop. Look at Rust and Go. https://lwn.net/Articles/548560/

Re: Android now supports Kotlin

#208

Where did Groovy go wrong ?

When it was created? Its dynamic types can often cause a headache (as you’ll notice when working with Grails, for example). Groovy’s creator famously said that, had he known Scala, he’d never have invented Groovy.

That was 10 years ago. Last year he tweeted "I still love groovy (jenkins pipelines are so groovy!), java, go, typescript and kotlin. I don't use scala anymore."[1]

[1] https://twitter.com/jstrachan/status/784333918078169088

Re: Android now supports Kotlin

#209

Earlier quoted context omitted.

I really wished they would choose Swift. It's open source now, and many developers would definitely enjoy having to learn only one programming language for developing native apps. Unfortunately, corporate policies and hubris matter more in these things.

And the massive technical undertaking of making the Android framework work with a none Java interoperable language? Kotlin was already mostly working with Android thanks to a community effort. This announcement just gives it Google's blessing and gives you all the Kotlin tools by default in Android Studio. Going forward they'll likely be working closely with the Kotlin developers, but this was primarily community dri…

Yes, but for a company like Google, "massive technical undertaking of making the Android framework work with a none Java interoperable language" doesn't seem like a big problem. Especially, given that they've had so much time to do so and they didn't do it.

Re: Android now supports Kotlin

#210
post #18

Post in JetBrains/Kotlin blog: https://blog.jetbrains.com/kotlin/2017/05/kotlin-on-android-...

I really wished they would choose Swift. It's open source now, and many developers would definitely enjoy having to learn only one programming language for developing native apps. Unfortunately, corporate policies and hubris matter more in these things.

While developers would love that, kotlin works because its interoperable with java. Swift doesn't have that. Try to add it and you'd shatter the swift ecosystem. Don't add it and people wouldn't adopt it because there's no path for gradual transition.
Post reply on HN