Live data from Hacker News

Android now supports Kotlin

venturebeat.com

161–170 of 225 posts

Re: Android now supports Kotlin

#161
post #106
post #5

Well this looks like going to push Kotlin in big league. I remember scala enthusiasts made big noise in last few years to have scala as officially supported language. But Google seems to prefer a closer relationship with Jetbrains.

The newest version of Scala (2.12) requires a JVM with Java 8 feature compatibility which makes it unusable on Android devices. Google would literally be stuck supporting an obsolete version of a language that's not developed... or restrict the use of it only to Android O and newer making it dead on arrival. Kotlin compiler generates code that's runnable on JVMs supporting Java 6, which makes it work on pretty much a…

Bit of an aside, but is the Kotlin compiler itself runnable on JVMs supporting Java 6? So you could compile on an Android device.

Re: Android now supports Kotlin

#162
post #106

Earlier quoted context omitted.

The newest version of Scala (2.12) requires a JVM with Java 8 feature compatibility which makes it unusable on Android devices. Google would literally be stuck supporting an obsolete version of a language that's not developed... or restrict the use of it only to Android O and newer making it dead on arrival. Kotlin compiler generates code that's runnable on JVMs supporting Java 6, which makes it work on pretty much a…

thought recent android's tools update meant I can use java8 on android devices... guess that requires a recent android device :(

The amount of supported features depends on the target API of the application.

Re: Android now supports Kotlin

#163
post #101

Earlier quoted context omitted.

Don't forget you can use Kotlin to write your build files for Gradle (since Gradle 3.0 was released almost a year ago) which Android Studio auto-completes 100% of the time (rather than 80% of the time as with Apache Groovy). Gradle 3.0 also switched to Kotlin as its "preferred" language for writing addins, so conceivably you could use the Kotlin language for everything in the Android build chain.

How would this help people who wants to use Bazel or any other build system other than Gradle?

For better or worse, Gradle is the official Android build tool, so why spend resources in something else?

Re: Android now supports Kotlin

#166
post #158
post #87

Earlier quoted context omitted.

I tend to agree. Sure, Kotlin is much more terse than Java. But looking at it I can't help much miss language features I've gotten used to in Rust, Haskell et al. I'm sure it's a wonderful language and an improvement over Java but there's nothing that excites me about it. Hey, at least they've got nullable types? That's a big win over Java right there.

> Hey, at least they've got nullable types? That's a big win over Java right there. Can you elaborate what you mean by nullable types? You can set Object variables to null and with primitives you can do the same with their boxed alternatives (Integer) but I assume you mean something different? Like the lack of types which can't be null? I can see how that's useful

I think they meant to say that Kotlin has non-nullable types.

The Kotlin page does a good job of explaining it if you aren't familiar. It's the single most important feature that makes Kotlin worth using over Java in my opinion: https://kotlinlang.org/docs/reference/null-safety.html

Re: Android now supports Kotlin

#167
post #164

Kotlin 1.1 supports coroutines what IHMO makes concurrency in a GUI much nicer. For example, it has C# like async/await methods; but more flexible...

So what does it do better than C# 7's async/await?

Its more flexible and customizable, e.g. works with RxJava, CompletableFuture, JavaFX, Android... Moreover, you have more control where a coroutine is executed. https://kotlinlang.org/docs/reference/coroutines.html

Re: Android now supports Kotlin

#168
post #164

Earlier quoted context omitted.

So what does it do better than C# 7's async/await?

Its more flexible and customizable, e.g. works with RxJava, CompletableFuture, JavaFX, Android... Moreover, you have more control where a coroutine is executed. https://kotlinlang.org/docs/reference/coroutines.html

Have you by any chance seen that I specifically mentioned version 7 of C#?

Which allows full control how async/await works, kind of like on the upcoming C++ co-routines, where async/await become syntactic sugar for blessed data structure.

EDIT: Should have provided the actual information.

The feature as introduced in C# 7 is called "Generalized async return types".

https://github.com/dotnet/docs/issues/1756

Re: Android now supports Kotlin

#169

I should note that Kotlin now supports JDK, JS, iOS, and LLVM as backends. Gradle also announced support for Kotlin. This means you can write your Android app, iOS app, web browser app, desktop app, and your build scripts -- finally all in the same language.

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.

Re: Android now supports Kotlin

#170
post #74

Earlier quoted context omitted.

Dart runs the AdSense code, because the AdSense team rescued the Dart team when the decision came to them stop being part of Chrome development efforts. Regarding Go at Google, if you have better sources of information to share with those living outside Mountain View, it would be very helpful.

I've never heard of the story where the AdSense team rescued the Dart team. Do you have a citation for this?

The story as I heard/read somewhere I cannot at this moment recall (InfoQ, conference networking, Podcast, blog,...), goes like this.

Many of the important devs on the V8 team, like Gilad Bracha, were getting tired of working on the project and started to look elsewhere for a career change.

Allowing them to create their own vision what a JavaScript replacement might look like (aka Dart) motivated them to stay on the team and at Google.

When the Chrome team decided that they wouldn't be merging the Dart VM into Chrome at all and would rather focus on JavaScript, including their efforts for adding type annotations to JavaScript, the Dart team was going to be assigned new tasks.

However in the meantime the AdSense team had started using Dart and they enjoyed using it quite a lot, so a decision was made to move the Dart team away from Chrome into supporting the AdSense team as main role.

If this is not true, I would welcome any Googler that knows better, to correct me.

Post reply on HN