Live data from Hacker News

Android now supports Kotlin

venturebeat.com

181–190 of 225 posts

Re: Android now supports Kotlin

#181
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.

And yet Microsoft did .NET Native precisely to target mobile platforms. Why do you think that natively compiled Kotlin would be slower than Go, anyway?

The difference being (I assume), that Microsoft has ownership of the entire .Net stdlib. The current android framework relies heavily on the java stdlib, which means that any attempt at a different language would have to bring a full rewrite of the framework itself.

Re: Android now supports Kotlin

#182

Earlier quoted context omitted.

Not sure what you're rambling about. Java is still and always will be the core language of the JVM. It isn't going anywhere and the Java team (comprising mostly ex-Sun people) continues to push the language forward under Oracle's fantastic stewardship. The issue is that Java is required to be more stable than other languages since it powers so many production, enterprise system and hence will be slower to innovate. I…

I think the Oracle/Google lawsuit drove the decision to adopt Kotlin. Now Google is going to work with JetBrains to develop Kotlin and is going to fork the GPL JVM probably by not including things like the controversial project Jigsaw that IBM voted down. Meanwhile, Oracle is stuck with Java, just like they're stuck with OpenOffice, Hudson, etc.

Jigsaw would actually help android. The entire reason Google went with their own implementation in the first place is to exclude certain APIs that were meaningless on android.

Re: Android now supports Kotlin

#184
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, and will write all of my React Native libraries in it (as soon as there is some support.)

UPDATE: Looks like the Kotlin runtime is around 859KB. Maybe smaller after ProGuard? In the grand scheme of things, that's smaller than many web pages. But it's probably not suitable for an open source library.

I don't think Facebook would rewrite React Native in Kotlin. I've heard that they might be moving towards C++, so that more code can be shared between the different platforms.

Re: Android now supports Kotlin

#185

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.

WOW, what?? That's amazing! I want to write some cross-platform native code for React Native modules, and I was considering Rust. But I will definitely have to check out Kotlin now.

Re: Android now supports Kotlin

#186
post #163

Earlier quoted context omitted.

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?

Because Bazel produces faster, reproducible builds, and can far better combine native and JVM code.

It’s a huge improvement.

Re: Android now supports Kotlin

#187

Looks like Kotlin will soon be skyrocketing to the top of the TIOBE charts.

Disclaimer: I am always looking for that Unicorn. The one that will let me write my code once and run it on all platforms. I refuse to give up this quest. I use Pycharm and have used other Jetbrains IDE's in the past. They make me soooo very happy to use. That is, I have tried almost every Python IDE and suped up Vim/Emacs; None of them came close to Pycharm for me. They know cross platform. Their IDE's are just as b…

I've found something that could possibly be the unicorn: React Native. Facebook's official motto may be "learn once, write everywhere" but I don't care. I've found that it's completely possible to "write once, run everywhere", even if it's not officially supported.

I'm still a few weeks away from launching, but I'm writing a little game that I'm going to ship on iOS, Android, Windows Phone and desktop (UWP), and web (with react-native-web.) They all share 99% of the code, except for a few native modules.

I've had to do a ton of work to get all of this working, but I'm going to release all of my changes, open source libraries, and a boilerplate so that it's easy to get started.

After the initial release, I'm going to be adding support for Mac, Xbox One (UWP), Apple TV, and maybe Linux. Mac and Apple TV are both forks of iOS that share 90% of the native code. Xbox One almost works out of the box, and I just need to add gamepad support. Linux is the only platform that is missing - Canonical's Ubuntu fork has stalled and no-one seems to be working on it.

I'm also keeping an eye on Kotlin. I just found out that it might be possible to write cross-platform React Native modules using Kotlin. (I was planning to use C++ or Rust for some shared code.)

Re: Android now supports Kotlin

#190
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 (keeping up to date with the changes in C++ and the STL is a mammoth task in itself).

Post reply on HN