Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Android Programming Google Operating Systems Software

Android Now Supports the Kotlin Programming Language (venturebeat.com) 91

In addition to Java and C++, Google announced at its I/O 2017 conference today that Android is gaining official support for the Kotlin programming language. VentureBeat reports: Kotlin is developed by JetBrains, the same people who created IntelliJ. Google describes Kotlin, which is an open sourced project under the Apache 2.0 license, as "a brilliantly designed, mature language that we believe will make Android development faster and more fun." The company notes that some have already adopted the programming language for their production apps, including Expedia, Flipboard, Pinterest, and Square. There are already many enthusiastic Kotlin developers for Android, and the company says it is simply listening to what the community wants. But Google's choice didn't just come down to the team believing Kotlin will make writing Android apps easier. Developers will be happy to know that Kotlin's compiler emits Java byte-code. Kotlin can call Java, and Java can call Kotlin. Indeed, "the effortless interoperation between the two languages" was a large part of Kotlin's appeal to the Android team. This means you can add as little or as much Kotlin into your existing codebase as you want, mixing the two languages freely within the same project. Calling out to Kotlin code from Java code should just work, while calling to Java code requires some automatically applied translation conventions.
This discussion has been archived. No new comments can be posted.

Android Now Supports the Kotlin Programming Language

Comments Filter:
  • Obligatory (Score:2, Insightful)

    by Anonymous Coward

    New week, new language-of-the-week.

    Fucking millennials can't use languages that have worked for decades because "it's old".

    Idiots.

    • Re: (Score:3, Insightful)

      Also, their claim to be "listening to what the community wants" is bullcrap. What people want is a language that can run on Android, iOS, and desktop. Currently, the only language that can do that is Javascript, which sucks.

      • Re:Obligatory (Score:5, Insightful)

        by OzPeter ( 195038 ) on Wednesday May 17, 2017 @05:56PM (#54437595)

        Also, their claim to be "listening to what the community wants" is bullcrap. What people want is a language that can run on Android, iOS, and desktop. Currently, the only language that can do that is Javascript, which sucks.

        There's this company you may have heard of called Microsoft. It's got this program called Visual Studio that you can use to write programs in a language called C#. It has this crazy feature where you can write one version of code and deploy it on iOS, Android, and Windows. Maybe you should check it out someday?

        • He said "desktop", not "Windows".

          Give me something that can target Android, iOS, Windows, macOS and Linux.

          • Oh, and it has to run in the browser. And in a kernel-free vmware deployment. Also, it has to make toast.

            What you want, what we all want, is a suite of languages, each with their own strengths, which work together seamlessly.

            • What you want, what we all want, is a suite of languages, each with their own strengths

              I am ok with one language for apps, another for quick scripting, and maybe another for 8 bit embedded microcontrollers.

              I am NOT ok with one language for Android apps, another for iOS apps, another for Windows, and yet another for the Linux desktop. That makes no sense. All of these require the same strengths.

              All Google is doing here is giving us yet another one-platform language. So now Apple has Swift and Google has Kotlin. I won't be using either, and neither should you.

              • I am NOT ok with one language for Android apps, another for iOS apps, another for Windows, and yet another for the Linux desktop.

                I agree.

                Having said that the idioms between in those UI environments are so different that in you need different UI layers on all of them. Anything less is a discourtesy to the users. (Remember Kai Krause interfaces? Yeah, that.) If you could write a small layer of Swift/Obj-C just to handle that in OS X/iOS, C# just to handle that in Windows, etc etc, there wouldn't be so much of an issue.

                And in practice, most "apps" are so trivial that the UI is basically the whole problem.

          • by Anonymous Coward

            Xamarin deploys to the Mac and I believe Linux support is on the way. It really is a good cross platform option.

          • by caseih ( 160668 )

            Yes, dotnet can indeed do all those things.

            MS bought the Xamarin stack to enable mobile development (Android and iOS) in C#. And of course dotNet core runs on Linux, OS X, and Windows.

          • C# can deploy to Windows and Windows Phone (kinda obviously) It also can target OS X, Linux, iOS, and Android, as well as less popular choices like Tizen and Fire OS. It can also compile down to HTML5/JS/WebGL. Gaming wise, as an MS product, it can support XBox 360 or XBox One, but it can also support Playstation 3, Playstation 4, Wii, Wii U and Nintendo Switch. And, there are a handful of of other platforms supported.

          • by MrDoh! ( 71235 )
            c#/Xamarin can target ios/android/windows/mac. Shame it's not also on Linux, but hey, Android runs on Linux,so...
          • by Zwets ( 645911 )
            Haxe [haxe.org]
        • Xamarin? I've actually tried it, and it's kind of bad. Sure, it works in principle, but it's a bit buggy and slow.

        • by niff ( 175639 )

          Xamarin lets you cross-compile when needed, but you cannot link or directly call Xamarin libraries from Java or Objective-C applications.

          That's a show stopper for us, because it means that your C# lives entirely in its own universe, without being able to interact properly with other libraries and services.

          In my experience, locking yourself into Xamarin works out great for small applications. In the same way that Dreamweaver worked great to design simple web pages. It's fast and brilliant, and it doesn't req

        • by Anonymous Coward

          I've used Xamarin, and I wouldn't wish it on anybody. When I get stuck it's with the transpiling (or whatever they call it) - the code mysteriously breaks with a cryptic error message and I'm stuck until I can get Xamarin support to help me. I use multiple programming languages on a daily basis, and having to work with C# converting to Objective C behind the covers is easily the most painful project I'm on.

        • It has this crazy feature where you can write one version of code and deploy it on iOS, Android, and Windows.

          That sounds pretty cool, but how portable is it really? It is easy to make a "Hello World" program portable, but what about portable access to UI features like the camera or accelerometer? Can I detect orientation and tilt in a portable way?

        • Well, there is Java, of course, which is undeniably mature and well supported by industry - and which runs on an astonishing number of platforms. And, you know, some of us are not into Windows and can't run Venereal Studio; but we can all run things like Eclipse, NetBeans and Android Studio.

      • Yes, and YES! Not impressed.
      • by Anonymous Coward

        Xamarin / C# is also a very good choice depending on your needs. It will deploy to iOS, Android, Windows UWP and I believe Tizen. I'm sure the Kotlin devs will claim they are tons more productive using it than writing Java while happily having another entire team to do iOS development instead of looking at some of the other tooling options....

      • What the Android community wants is, indeed, a better Java. The rest of the software world knows that this probably isn't a good idea, but the Android community wants that.

        Currently, the only language that can do that is Javascript, which sucks.

        Kotlin also targets JS, by the way, which also makes it a better GWT. Again, this is not what most of the software world wants, but it's exactly what people who use the Google Platform want.

      • by jblues ( 1703158 )
        The only? C# runs on the desktop and the backend. And also on iOS and Android using Xamarin [xamarin.com], which is owned by Microsoft. The same went for Kotlin, until recently when iOS fell off the radar. That's because RoboVM [robovm.com] was bought by Xamarin.
    • It's not millenials, this has been going on for a long time. Used to be a magazine called Computer Languages, which was all about new computer languages (duh).

      Keep in mind, at one point C, C++, Java, Javascript, D, whatever were hot new languages.
    • What milllenial developers really want is for all of us to use only web browsers and API's for everything, destroying the desktop so FOSS goes away and they can make their money and have all the control and make even more money by selling the statistics from usage. I don't want table scrap APIs from Google or M$ or anything people are calling "open source" when it only runs on a server. But, it's the summer time so get ready for all the "Drupal, Azure, OpenStack, and DigitalOcean" articles.
    • Well, why spend time doing something productive when you can keep changing your programming language every month/week, and complain about how old and stupid everyone else is for not using the latest fads. For everything, even if it only really doesn't scale, is silly for quick prototyping, or whatever.

      Software as a career is great in your 20's when all you want to do is tell everyone how great your new programming language is, and how much they suck for not loving it. Dozen(s) of fads later, I mainly just w

  • by Anonymous Coward

    NEXT!

  • This looks an awful lot like ruby. Can someone show me the differences?
    • There are a few differences:

      1. It's statically typed.
      2. It compiles to JVM and JavaScript.
      3. It's nothing at all like Ruby, except to the extent that Ruby borrows from the same languages that Kotlin borrows from.

      • There are a few differences:

        1. It's statically typed.
        2. It compiles to JVM and JavaScript.
        3. It's nothing at all like Ruby, except to the extent that Ruby borrows from the same languages that Kotlin borrows from.

        It's
        A) Curly braces
        B) OO boilerplate

        So I throw it in the same basket with C++, C#, Java etc.

        It also isn't a real language because it compiles to a JVM rather than machine code. So it's less useful than C.

        • One can create a C compiler that outputs bytecode, just like it can create executables that run on RISC and CISC architectures as will add Harvard and non-Harvard. The same goes for Java, Python, etc. Your comment represents a general lack of understanding of languages and their implementations, and a false belief that the two are tightly coupled.
          • >One can create a C compiler that outputs bytecode

            You could but if you chose to not bother, you would get a faster executable that doesn't need a boatload software bloat to even run.

            >Your comment represents a general lack of understanding of languages and their implementations, and a false belief that the two are tightly coupled.

            No. It represents disillusionment at there still being nothing much new after 30 years of hardware and software development.

            • You could but if you chose to not bother, you would get a faster executable that doesn't need a boatload software bloat to even run.

              I still remember the day when Microsoft C Compiler had an option to compile to bytecode. In the days of 16-bit, it made a certain amount of sense because memory was tight and the code density was so much better.

              • You could but if you chose to not bother, you would get a faster executable that doesn't need a boatload software bloat to even run.

                I still remember the day when Microsoft C Compiler had an option to compile to bytecode. In the days of 16-bit, it made a certain amount of sense because memory was tight and the code density was so much better.

                The apple ][ came with a bytecode called Sweet16 that let you do 16 bit code on an 8 bit CPU and yielded better code density. But requiring a browser or JVM seems to require a large amount of code bloat.

                • Not to mention the BASIC interpreter.

                  Most modern applications manage to be bloated even without an interpreter. All that spyware doesn't write itself. The bigger problem is battery life.

          • I assumed TechyImmigrant was joking with the 'real language' thing. Could be wrong.

        • It's
          A) Curly braces

          For some reason, the programming world has convinced itself that "C-like" means "curly braces".

          B) OO boilerplate

          Again, for some reason, the programming world has convinced itself that "OO" means "Simula".

          Programmers really don't understand programming languages.

          • It's
            A) Curly braces

            For some reason, the programming world has convinced itself that "C-like" means "curly braces".

            B) OO boilerplate

            Again, for some reason, the programming world has convinced itself that "OO" means "Simula".

            Programmers really don't understand programming languages.

            Some programmers don't respond well to subtlety in humor, even when it's not very subtle at all.
            I'm not a programmer. I have programmed, but these days, I make computers do my bidding by force of will.

  • I'll never heard of this new flavor of the week. But I had heard of Jetbrains. I use PyCharm IDE every day.
  • Kotlin is like Swift (Score:1, Interesting)

    by Anonymous Coward

    I've been using Kotlin for Android development for a while now. It's not a passing fad, and it may one day overtake Java in many things. It's just Java with additional desperately needed features.

    I've heard no one whine about Swift being the flavor of the week, and yet, if you compare the languages, they are almost the same language with some slight syntactic differences. Both have null-safe typing. Both have lambdas quickly accessible. Both have extension functions. Both have interfaces that can contain de

  • by Anonymous Coward

    So I click the first link "concise" and it shows me how to make a singleton. I thought singletons have basically been declared to be an anti-pattern. They're basically a name for an obfusticated global and make testing difficult.

    Not very inspiring to see a bad example as the first introduction to the language. It doesn't give much confidence that the team making the language actually gets bets practices.

    • by Anonymous Coward

      Scala developer here. That functionality (including the "object" keyword) is cribbed more or less directly from Scala.

      It is a complete replacement for the "static" keyword. Instead of having a class named Foo that has random functions in it that you can't actually call on an instance of Foo, you have a separate object Foo sitting next to it where all that stuff resides.

      That is a huge step in the direction of less obfuscation, not more.

      The bigger problem is that all of the features listed are either cribbed

      • by robmv ( 855035 )

        An one of the reasons (of many) I reverted some of my applications modules written in Scala back to Java is the easy of use of the object singletons. Nearly all Scala libraries use them, making using those libraries in a shared context, for example an EAR lib directory or as app server module/plugin a nightmare. Singletons reused between different applications and the only way to maintain isolation is to ship the same library multiple times on each WAR of a EAR wilth multiple WAR.

        So no, I don't like languag

    • No. Singletons are not an anti-Pattern, and are not the same as Globals. They implement encapsulation and enforce an interface. This means when you change the singleton your code doesn't break because you didn't hunt down every instance where the global is manipulated and make sure it manipulates it the newly defined and implemented way. That's just one difference.
  • "a brilliantly designed, mature language"

    I have no reason to be suspect of the first part of that statement, but "mature"? Come on.

    Is it just me, or do you all find the recent move to platform-specific languages very worrying indeed? So for anything MS-like we're supposed to be C#, on xOS the new hotness is Swift, and on Android, it's Kotlin (or Go? or Java?).

    What's worse is that the only really cross-platform language remains C (there's plenty of real platforms with marginal C++, iOS for instance) and even

  • by robmv ( 855035 )

    I find it ironic that the people (Android team engineers) that don't want to use Java enums on Android APIs because they add "bloat" are embracing another language that adds more overhead over plain Java (increased application size for example) than enums could add.

"We don't care. We don't have to. We're the Phone Company."

Working...