25 ms·
Android now supports Kotlin
- tomc1985 9y agoFunny, I was messing around with Kotlin for the first time last night. So far, the language seems well-structured and I really like that one gets all of Java's ecosystem without actually having to write java. (Also, "override fun" just sounds hilarious. Bwaha!) Throw in TornadoFX and Gluon Scene Builder (formerly of Oracle) and you're spinning up high-quality cross-platform GUIs faster than Atom, with a visual editor, and without having to touch Javascript! I've been trying to find a suitable, high-quality cross-platform GUI kit for a while and this looks like it might challenge my current favorite (GTK)
- gecko 9y agoIs JavaFX also included in the "safe" parts of Java (i.e., in an Oracle-sanctioned GPL VM)? I know there are some open-source versions, but Oracle's trigger-happy lawsuit button on Java these days has made me nervous to poke.
- Nullabillity 9y agoOpenJFX is part of Oracle's OpenJDK project.
- floatboth 9y agoIt even works on FreeBSD https://www.freshports.org/java/openjfx8-devel/ https://www.freshports.org/java/openjfx8-devel/ so yeah, truly cross-platform open source GUI :)
- deskamess 9y agoNew to Kotlin + ecosystem... So can you build Android UI's with Scene Builder? I see notes about it working with Gluon Mobile which appears to be a cross platform mobile library.
- tomc1985 9y agoNot concerned about Android at the time, I was looking for a desktop app toolkit. Now that you mention it mobile support seems to be in flux: http://stackoverflow.com/questions/20860931/is-it-possible-to-run-javafx-applications-on-ios-android-or-windows-phone-8 http://stackoverflow.com/questions/20860931/is-it-possible-t...
- bitmapbrother 9y agoNo, Android does not support JavaFX or Swing for that matter.
- tomc1985 9y agoFrom what I've read the open-source bits of Gluon Mobile are available for free via JavaFXPorts http://gluonhq.com/products/mobile/javafxports/get/ http://gluonhq.com/products/mobile/javafxports/get/ <-- android, iOS, ARM However it seems to be a barebones solution as it lacks mobile-specific controls (they want you to buy Gluon Mobile for that)
- on_and_off 9y agoNot really. Android has its own graphical stack. You might be able to write an ndk app targeting android with you own stack of widget, but that's very different from an 'sdk' app.
- s73ver 9y agoFor Android, just use it's UI toolkit. It'll work better than trying to shoehorn a 3rd party thing in.
- invalidname 9y agoThe problem is its performance on the device and size overhead is horrible. Javafxpackager is just about the worse too. Check out Codename One which is more like Swing but far more robust. The GUI builder isn't as refined as scene builder but the final product actually works everywhere and far more portable than anything else.
- monkmartinez 9y agoCodename one "Professional Edition" is $79 per month! Basic is $19 per month... As a kind of "indie" developer that is very expensive. Gluon Mobile is not much less expensive at $42 per month. Still, free edition looks better than Codename 1 free edition. Wondering if Jetbrains will release Kotlin/Native for a set price or charge monthly like most companies are doing these days.
- invalidname 9y agoCodename One is open source and has a free edition without nag screen or any license restrictions. For that $19 you get more platforms and no need for a Mac etc.
- tomc1985 9y agoBut you have to use their BS cloud build service? Hell no.
- invalidname 9y agoInstead of having both a Mac and PC which is the only other alternative that's physically legal. Notice that this is a compile time feature, you don't need to use it for production.
- reitanqild 9y agoWhy so negative? I'm also against "cloud everything" but here they seem to provide an actually useful service.
- 9y ago
- mahyarm 9y agoI call Kotlin Android's Swift.
- real-hacker 9y agoExactly!
- mastazi 9y agohttp://nilhcem.com/swift-is-like-kotlin/ http://nilhcem.com/swift-is-like-kotlin/
- balladeer 9y agoWow.. Swift is reading a lot like JS and TS. (PS. I am new in both the languages and no Swift expertise)
- tooFastFuckYou 9y agoHeaven forbid they just support Swift instead.
- oakesm9 9y agoYou'd need to rewrite Swift to run on the Android VM (a big undertaking) or fork the Android frameworks to work well with Swift. That's a much bigger undertaking than supporting a language which was created for the JVM and specifically made for interoperability with Java.
- ptx 9y agoUnfortunately the JavaFX menu bar is just as broken as the one in Swing. In particular (I'm sure there's more), 1. it gets very confused about the focus when alt-tabbing between windows (as alt, on Windows, also toggles focus on the menubar), 2. there is no attempt to solve the problem of submenus disappearing when you attempt to move the pointer towards them, which is solved in Windows and Qt with a delay, and in Mac OS and GTK with ... the solution that is actually documented in the OpenJDK wiki but not implemented: https://wiki.openjdk.java.net/display/OpenJFX/Menu+User+Experience+Documentation#MenuUserExperienceDocumentation-3.DetailedBehaviors https://wiki.openjdk.java.net/display/OpenJFX/Menu+User+Expe... So JavaFX might be high-quality in some way I haven't noticed, but to me its immediately noticeable qualities were its general slowness and brokenness.
- bobsam 9y agoWas hoping for golang but this is good too
- mandude 9y agoWhy haven't they supported Go on android?
- monkmartinez 9y agoTotal guess, but maybe they see the actual usage numbers of developers that use Go? AND that number is not very high. Also, how well does Go translate into Android apps? Just a guess.
- H1Supreme 9y agoI like writing Go, and it's my go to (pun intended) for writing web API's. Building a framework around it for Android apps would be a mighty task. Kotlin makes more sense considering it's connection with the JVM. I'll keep writing Java to build Android apps though. I'm sure it's "more fun" or whatever, but Java's worked just fine for me thus far. I'm used to the verbosity, and have no desire to start from scratch with another language. If some huge benefits were presented, I would. But, I'm failing to see any.
- fstephany 9y agoYou can mix Kotlin and Java in the same project easily. I have a project where we have a bit of both. All the new code is written in Kotlin and some older features are converted to Kotlin when we feel like it.
- monkmartinez 9y agoI kind of gave up on Java and Android a few years ago and picked up Python. I have given Go a whirl... but it doesn't tick all the boxes for me. I really, really want to build apps for all the platforms with one language and awesome GUI's.
- 9y ago
- 0xFFC 9y agoIs this official? Edit: sorry, I completely forgot googleio is today, and i couldn't believe this kind of news comminng ftom non google domain.
- luisramalho 9y agoYes.
- ttam 9y agoYes, they announced it a few minutes ago on I/O
- Twirrim 9y agoYou'd know the answer if you'd taken the < 1 minute to read the article. It was mentioned in the opening paragraph.
- geodel 9y agoWell 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.
- pjmlp 9y agoScala never worked that well, for example it requires several steps, focus on sbt, requires the pure InteliJ version instead of Android Studio, thus forcing developers to be a few versions behind on Android plugins. http://scala-on-android.taig.io/sources/ http://scala-on-android.taig.io/sources/
- ajross 9y agoIIRC Scala also has a decidedly non-trivial runtime library with its own set of abstractions, where Kotlin is basically "better syntax" on top the existing JDK/Android library ecosystem. Writing Scala to deal with an existing Java framework "feels like" working with an FFI, where in Kotlin it's more natural.
- stusmall 9y agoBecause of that non-trivial runtime when I used it, it also required pro-guard. I like proguard but it comes with its own set of issues. I typically set it up at some point in a project, but I don't want it required as a first step on a new project.
- allover 9y agoI don't see what it has to do with relationships. Convince us why Scala would've been a better choice?
- dhfhduk 9y agoI 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 hair out. Languages like Scala, Haskell, Rust, etc. are preferable to me in that way. Kotlin seems nice and clean--from what I've seen so far, with this "Android bump", Kotlin native, etc., I could even see it replacing Python--but I worry there's something lurking deeper. This is the clearest thing I've found so far, but it's very old at this point: http://codeofrob.com/entries/looking-at-kotlin---kicking-the-java-inheritance-addiction.html http://codeofrob.com/entries/looking-at-kotlin---kicking-the... It includes this quote that stokes my fears: "It feels as if the language designers haven't really designed at this point, they've just thrown a load of stuff at the wall because inheritance is something that all Java developers want and given us a few bad ways of doing something as well as something that has the potential to make us write better Java." I don't have any attachment to Scala. However, I do think Scala, Rust, etc. have moved language design forward in significant, fundamental ways, and it would be nice to see those advancements recognized in the Android platform. Take this all with a grain of salt, though, because I know next to nothing about Kotlin.
- jorgemf 9y agoIf 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!).
- jshevek 9y agoKotlin is an absolute pleasure to code in, far better than Java. Add in such easy mixing with Java code, and it's by far my favorite JVM language.
- 72deluxe 9y agoOut 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).
- vbezhenar 9y agoThere'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.
- dmix 9y agoGoogle/Android's answer to Swift?
- deleted 9y ago[deleted]
- thawab 9y agoI prefer to think it's an answer to java/oracle.
- giobox 9y agoI was curious how this fits in to the bad blood between Google and Oracle over java, but the 'reporting' I've read on the usual tech sites appears little more than rehashing the Google press release. Does this help them build a road away from Java entirely eventually? Could Kotlin eventually provide a route away from the JVM, especially this Kotlin native stuff on LLVM?
- nathan_f77 9y agoYes, they are extremely similar languages. You can see some of the similarities in this blog post: https://ragunathjawahar.wordpress.com/2015/03/18/my-first-ios-app-while-learning-kotlin-for-android/ https://ragunathjawahar.wordpress.com/2015/03/18/my-first-io...
- hota_mazi 9y agoThe official tweet: https://twitter.com/Android/status/864911929143197696 https://twitter.com/Android/status/864911929143197696
- monkmartinez 9y agoSo where is the best place to learn Kotlin? I am very interested as Jetbrains is also working on Kotlin to native translation. [1] [1]https://blog.jetbrains.com/kotlin/2017/04/kotlinnative-tech-preview-kotlin-without-a-vm https://blog.jetbrains.com/kotlin/2017/04/kotlinnative-tech-...
- faitswulff 9y agoThey link to resources at the bottom: > For more information on getting started with the programming language, check out How to start using Kotlin[0] and the Koans tutorial[1]. [0]: This one's actually broken in the article, but: https://kotlinlang.org/docs/tutorials/kotlin-android.html https://kotlinlang.org/docs/tutorials/kotlin-android.html [1]: https://kotlinlang.org/docs/tutorials/koans.html https://kotlinlang.org/docs/tutorials/koans.html
- Larrikin 9y agoIf you're already familiar with Android dev, using the built in Convert Java to Kotlin feature in Android Studio is invaluable, especially in the beginning.
- Ciantic 9y agoPost in JetBrains/Kotlin blog: https://blog.jetbrains.com/kotlin/2017/05/kotlin-on-android-now-official/ https://blog.jetbrains.com/kotlin/2017/05/kotlin-on-android-...
- behnamoh 9y agoI 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.
- oakesm9 9y agoAnd 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 driven.
- behnamoh 9y agoYes, 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.
- swsieber 9y agoWhile 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.
- bitmapbrother 9y agoLooks like Kotlin will soon be skyrocketing to the top of the TIOBE charts.
- 0xFFC 9y agoAnd a little bit of drop in java ranking
- dep_b 9y agoGod I hope so. Every time I see Java up there I feel the suffering of a million souls having to deal with it.
- monkmartinez 9y agoDisclaimer: 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 bad ass on the macOS as they are on Windows... again, for me. They make IDE's for just about everything and I assume they are all of stellar quality. My assumption, as of about 30 minutes ago, is that Kotlin could be a great bet for cross platform development in the near, near future. Jetbrains has every reason for this language to succeed in as many places as possible. Web, Mobile and Desktop. The fact that it runs on the JVM and compiles to JS out of the box makes me wonder why I haven't tried it yet.
- narrator 9y agoOracle winds up killing another golden goose they aquired from Sun. That's what they do though. They buy innovative technology companies who have committed customer bases and then slowly squeeze all the money out of them until they can migrate off. By then they've aquired another set of victim customers.
- threeseed 9y agoNot 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 have seen no widespread movement to jump from the Java/JVM ship if anything more and more people are moving towards it because of languages like Scala, Clojure, Kotlin etc.
- narrator 9y agoI 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.
- izacus 9y agoNah. What drove the decision is that huge swaths of Android development community already adopted Kotlin and it's trivial to implement it in existing Android codebases. It's also built by a company with which Google already has partnership with (IntelliJ built both Kotlin and IDEA IDE which is the base for Android Studio).
- vickychijwani 9y agoYes, this is the only reason IMO. GP is reading too much into this. Source: I closely follow all developments in the Android ecosystem, and have been doing so for over 2 years.
- 0xFFC 9y agoAfter becoming first officially supported non java language in android now, All eyes are on kotlin native! If they can deliver good kotlin native experience, then kotlin is unbeatable
- johnhattan 9y agoI'm assuming that this is going to work natively via LLVM, as Kotlin's original target was JVM bytecode, which should work fine on Android right now.
- dfabulich 9y agoToday, Android cross-compiles JVM bytecode to its own non-JVM bytecode; I'd assume they'll continue using a two-stage approach for Kotlin.
- Skunkleton 9y agoKotlin claims future capability for "Native" applications. I assume that this is separate from "Android" applications, even if these are compiled to native instructions.
- theWheez 9y agoCorrect, they are working on targeting LLVM
- w8rbt 9y agoI wonder if Android will ever support Go? Seems Google would want to do this.
- wickawic 9y agoI was about to reply that go seems more systems oriented, but on second thought that is really more of a self fulfilling prophecy. With the proper library support I bet go would be a great language for mobile development.
- dcu 9y agothe bigger issue with Go is the binary size
- izacus 9y agoGo (like other non-JVM languages) doesn't talk to Java APIs well - the JNI bridge is ugly and adds a severe performance penalty. Short of actually rewriting Android itself, it's probably not going to happen.
- adrianlmm 9y agoCongratulations to Jetbrains.
- KingMob 9y agoWould be lovely if they officially supported Clojure too.
- gshayban 9y agoI'd love that too, but there is a startup time overhead with the Clojure runtime. Given the moves Google's made in recent wrt moving away from JIT for startup time reasons, this would be challenging.
- jakebasile 9y agoI'm with you, but I think the size and startup time of Clojure might be a big hurdle.
- MBlume 9y agoIf you want to use Clojure on Android, I'd recommend Clojurescript and React Native https://github.com/drapanjanas/re-natal https://github.com/drapanjanas/re-natal
- on_and_off 9y agoGoogle has chosen to support kotlin because the community has very strongly pushed in that direction. I am not too familiar with Clojure, what would it bring us that kotlin (or java) don't have ?
- Skunkleton 9y agoParenthesis. And lots of other things too. I just wanted to make a lisp joke. I will see myself out.
- vickychijwani 9y agoAs much as I want this, it's not going to happen for the simple reason that Clojure adds a big runtime and a huge startup cost on Android, which is unacceptable. It's fine for servers, but a total deal-breaker for mobile apps. Kotlin on the other hand has a tiny runtime (< 1 MB before dead-code elimination etc with Proguard) and negligible startup cost - in fact several popular Android libraries have a bigger startup cost impact than Kotlin.
- sswezey 9y agoThis, along with recent Kotlin Native news, lends me to believe Google is investigating some alternative platforms for replacing their dependence on Java APIs and removing any possibility of being further hamstrung by Oracle.
- kbumsik 9y agoThis news sounds quite opposite to me. Although adding a new language is always a good news but Kotlin won't solve any problems with Oracle, since it is just another JVM language. This news sounds like Google is going for an easier way instead of ditching Oracle stuff.
- realharo 9y agoIt does open up a path for a possible future migration to Kotlin Native (in several steps), but that's really just wild speculation.
- Entangled 9y ago> since it is just another JVM language Not for long, they're working on Kotlin Native which will make it completely independent from the JVM and portable to all platforms. Killer.
- kodablah 9y agoThat's with Kotlin's much smaller runtime. It's the stdlib that matters, not the language. Which is why the JVM or an emulated version of it will be around on Android for a long time.
- geodel 9y agoThat 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.
- dep_b 9y agoGood move. Out with possible null pointers everywhere for no freaking reason at all. It's 2017. Apple did a great job with Swift but launched it when it wasn't mature yet but Kotlin will have JetBrains level of IDE support from the get go so and it's mature already only a luddite would stay with Java.
- melling 9y agoApple released Swift early (June 2014) so that it could be used in real programs, and so that developers could provide feedback. You weren't, and still aren't, forced to use it. Although, it seems to have matured enough in 3 years to the point where it's probably the best iOS development language. Kotlin was released in 2011. I bet that if Google had adopted it three years ago, it would have helped accelerate Kotlin adoption and Kotlin would be even further along today, having a much larger developer community.
- johnnycerberus 9y agoKotlin was released on 15 February 2016.[0] [0] https://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-released-pragmatic-language-for-jvm-and-android/ https://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-release...
- gregschlom 9y agoThat's the 1.0 release, but it has been in public alpha / beta since 2011 or 2012. https://blog.jetbrains.com/kotlin/2012/04/kotlin-m1-is-out/ https://blog.jetbrains.com/kotlin/2012/04/kotlin-m1-is-out/
- melling 9y agoIt 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) 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.
- mangoman 9y agoThis is pretty big. I really like Kotlin, but when I tried to integrate it into my app, it just didn't play well with popular libraries which rely on compile time code generation (Google's Dagger fork, Icepick, Parcels, etc). Has support for this improved / is it easy to integrate?
- floatboth 9y agoAnnotation processing has been improving a lot https://medium.com/@workingkills/pushing-the-limits-of-kotlin-annotation-processing-8611027b6711 https://medium.com/@workingkills/pushing-the-limits-of-kotli...
- gagege 9y agoWe use Dagger2 extensively with Kotlin where I work and it works very well. I haven't used the other libraries you mentioned.
- on_and_off 9y agoI have a project with Kotlin + Dagger + DataBinding. Annotation processing works fine with kotlin. First setup can be a pain though, especially if you are not familiar with Android or the gradle build system.
- theWheez 9y agoI'm hopeful that with official support this process will become smoother
- on_and_off 9y agoIt was rough because I had to write the script myself (one year ago). You need to know some things that are not obvious at first glance, like the fact that the databinding compiler is versioned with the android plugin for gradle. Nowadays, you can just copy paste it from an existing github project.
- maaaats 9y agoWhat does it mean being "supported", given that one already can use Kotlin on Android?
- bdavisx 9y agoWell, if you work in a more conservative company, you can use this as a way to get the "powers that be" to allow the use of Kotlin. It's basically an endorsement of the language by a company that everyone has heard of.
- kartickv 9y agoIt's not just conservative companies, but also independent developers and startups that may not want to start investigating third-party languages, of which there's no shortage. Particularly if they're up against other barriers like not being experienced at Android, in which case they may not want to learn the Android frameworks AND a new language at once. Or they have to learn some new Android frameworks they didn't use before, like the camera APIs.
- Larrikin 9y agoBuilt into Android Studio without having to install anything extra seems like the main draw. Official support will also make it easier for people to push for Kotlin in larger projects
- pjmlp 9y agoIt means: - being documented on https://developers.google.com https://developers.google.com - being installed by default with the SDK - having official tutorials provided by the Android team using Kotlin - having code samples provided by the Android team using Kotlin Providing the confidence to many companies out there that Google will not change Android in a way that Kotlin compiled applications would stop working.
- ehsankia 9y agoRight, the title of the article is pretty awful and misleading. The language used at the conference was "Kotlin is now a first-class supported language". First-class supported means it gets all the treatments you mentioned above, and probably better tooling by Google for development.
- maxpert 9y agoFinally!!! JetBrains has been doing an awesome job on Kotlin. Languages is a very subjective and taste specific thing, but it's way better than just having Java. Anyhow I have been arguing over moving to it for quite some time now here is a shameless plug https://hackernoon.com/in-pursuit-of-better-jvm-futures-kotlin-coroutines-281a79211b09 https://hackernoon.com/in-pursuit-of-better-jvm-futures-kotl...
- fishywang 9y agoI hope this will change Jetbrain's attitude towards supporting Kotlin Android rules in Bazel (or anything other than gradle). Last time I asked, they are not very interested[1]. [1] https://discuss.kotlinlang.org/t/android-support-in-kotlinc-cli/2396 https://discuss.kotlinlang.org/t/android-support-in-kotlinc-...
- vorg 9y agoDon'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.
- fishywang 9y agoHow would this help people who wants to use Bazel or any other build system other than Gradle?
- pjmlp 9y agoFor better or worse, Gradle is the official Android build tool, so why spend resources in something else?
- kuschku 9y agoBecause Bazel produces faster, reproducible builds, and can far better combine native and JVM code. It’s a huge improvement.
- pjmlp 9y agoBut isn't part of the Android SDK, Gradle is. As I learned through the years, anyone that decides to step outside the SDK tooling accepts the lack of productivity that entails the extra work, making the unofficial tools fit into the SDK expectations. So why should JetBrains spend development resources (work time * salary / hour) into something that isn't a standard tool just to get brownie points?
- Entangled 9y agoI love Kotlin and her twin sister Swift. They're both beautiful and allow you to code apps for the desktop, server, mobile, watch, TV, IoT, and everything in between. They're here to stay and they're a joy to use. Jump on the happy wagon and join us!
- MBlume 9y ago"To get started with Kotlin, download the Android Studio 3.0 preview, open one of your existing Java files, and then choose “Convert Java File to Kotlin File” in the Code menu." You do not have to install a preview version of Android Studio, you can install the kotlin plugin in whatever version of AS you're using now. The change in AS 3.0 is simply that it will ship the plugin by default.
- steedsofwar 9y agoIt doesn't need to be a preview version of AS. I'm coding with Kotlin on AS 2.3.1 and IntelliJ 16. Just make sure you configure kotlin for the project, easily done, by creating a kotlin file.
- MBlume 9y agoThat's what I said =)
- rdsubhas 9y agoI'm curious to know, just from a general understanding - How much of the situation changes when Java 9 releases? Will it lead to some features in Kotlin becoming redundant/unnecessary, some other new features open up in Java 9, grass-is-greener situations, etc?
- V-2 9y agoJava 8 won't be supported on Android, at least not on most devices, for a while still, so I can't see why the release of Java 9 would be a game-changer all of a sudden
- deleted 9y ago[deleted]
- agumonkey 9y agoPretty big step up for kotlin. And for programming in general.
- giarc 9y agoAnyone know of good online tutorials for Kotlin? I learned Swift for iOS development and customers have been asking for an Android version of my app. Sounds like Kotlin would be a good second language to learn.
- on_and_off 9y agoThe official docs has the best tutorials I have ever seen for a new language. 1 - skim the language documentation (depending on your familiarity with java, this will be more or less easy) 2 - download intellij, clone the kotlin koans repo and do these exercices. After finishing the koans, you will have a good grasp at kotlin's basics.
- V-2 9y agoThe Kotlin plugin (for Android Studio; starting from 3.0 presumably built-in) allows for converting Java code to Kotlin automatically. Obviously the outcome is not necessarily idiomatic Kotlin, just the most straightforward equivalent - but still, it's a very quick way of getting up to speed with the syntax.
- gigatexal 9y agohey maybe this means we will eventually be able to build apps in other languages to that target the JVM like Jython (or pure python would be cool). Eh, I'm moving on from Python so if they never threw the ability to build apps for android with python that'd be fine, too. Am I the only one that finds Java's (and Java 8's) syntax fine. I like the traditional type annotations and perceived verbosity.
- bedros 9y agowhy not use llvm as virtual machine instead of JVM assuming backward compatibility is not an issue.
- nv-vn 9y agoBackwards compatibility is an issue when 50% of users aren't even using Lollipop yet. Also LLVM is no longer an actual VM.
- mncolinlee 9y agoI 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.
- virtualwhys 9y agoThat'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.
- ptx 9y ago"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 on different platforms, but it's hardly "unknown". The size of generated JS is definitely a problem at the moment but they're working on it: https://discuss.kotlinlang.org/t/kotlin-js-file-size/2501/2 https://discuss.kotlinlang.org/t/kotlin-js-file-size/2501/2
- virtualwhys 9y agoThe 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.
- 9y ago
- czeidler 9y agoKotlin 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...
- pjmlp 9y agoSo what does it do better than C# 7's async/await?
- czeidler 9y agoIts 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 https://kotlinlang.org/docs/reference/coroutines.html
- pjmlp 9y agoHave 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 https://github.com/dotnet/docs/issues/1756
- steedsofwar 9y agoKeep in mind coroutines is very much experimental, things will change.
- _sy_ 9y agoThe Instamotor Android app is entirely built using Kotlin.
- amaks 9y agoSteve Yegge had this to post about Kotlin: http://steve-yegge.blogspot.com/2017/05/why-kotlin-is-better-than-whatever-dumb.html http://steve-yegge.blogspot.com/2017/05/why-kotlin-is-better...
- ktkization 9y agoWhere did Groovy go wrong ?
- kuschku 9y agoWhen 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.
- vorg 9y agoThat 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 https://twitter.com/jstrachan/status/784333918078169088
- nathan_f77 9y agoI'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.
- vbezhenar 9y agoRewriting 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.
- vickychijwani 9y ago> Kotlin compiles to Java bytecode, so you don't need to deal with JavaScript engines, serialization/deserialization, etc. I don't think the GP meant replacing JS with Kotlin, rather they're referring to implementing React Native modules in Kotlin instead of Java, keeping the JS part untouched. (As you may know, React Native modules/components require native implementations before they can be used in JS). I hope that clears things up a bit!
- skdotdan 9y agoWill Google end up buying Jetbrains?