1. 15

I really enjoy Kotlin, but one downside to Microsoft buying RoboVM is I assumed we’d never see Kotlin on iOS. Apparently, JetBrains has decided to tackle that issue directly by making Kotlin compile natively for iOS (and macOS and Linux).

    1. 2

      Will be interesting whether Kotlin adoption will surpass Scala in the near future.

      Scala is clearly the better language, but from a developer POV, Kotlin …

      • has better tooling
      • has better documentation
      • has better marketing
      • has more resources
      • can leverage existing JetBrain products (e.g. it’s easier to have pain-free interop with C/C++/Objective-C/Swift code if your company already has an existing C/C++/Objective-C/Swift IDE)

      Considering that “better technology” has almost never won against “better marketing” alone, it seems like the odds are in Kotlin’s favor.

      1. 7

        Why is Scala the better language, can you elaborate on that?

      2. 7

        I see this claim a lot, but I really don’t understand it. Yes, Scala has more features than Kotlin, but I don’t agree that necessarily makes it a better language.

        I’d hope we can agree for starters that more features doesn’t necessarily make a language better. The more features there are, the more you have to learn to be comfortable in the language. This in turn increases the chance that any given code base will use only a certain subset of the language. This is why languages like C++ and Haskell have such high learning curves, and also why being proficient in any given C++ or Haskell code base may not immediately translate to you being proficient in another. (E.g., going from a C++ team that has said no to std::move and lambdas to one that does is going to result in you seeing a lot of code as non-performant that works fine, and conversely cause you to be much more verbose than you need to be. Or going from a Haskell project that makes heavy use of lenses to one that doesn’t is going to take away one of your go-to tools for data transformations, requiring you to pick up whatever alternative that project uses.)

        Beyond that, a lot of Scala’s features have real cost. The incredibly flexible syntax is part of why Scala’s compilation is incredibly slow. (That syntax is also a big part of why Scala IDEs lag behind so badly.) Some features, such as implicits, make code tremendously more difficult to quickly understand and reason about. Other features make interop with Java significantly more difficult (calling Java from Scala’s quite easy, but the reverse can be tricky when you get into Scala-specific constructs–implicits being a great example of that, too.)

        Kotlin, on the other hand, deliberately does less. It has a more uniform syntax, so it’s not as flexible, but that makes it easier to learn and easier to build tools around. It doesn’t provide enough language-level richness to do some of the things Scala can do, but that in turn means that Java/Kotlin interop is stupidly straightforward, so it’s easier to bring gradually into an existing code base.

        I do not agree that Scala is “clearly better” than Kotlin. I do think it has more features, but those features come at a cost, and that cost is why I strongly prefer Kotlin.

        1. 4

          The Scala grammar is about half the size of Kotlin[1], but its feature set is more orthogonal and powerful. Odersky explains it there from 03:30 onwards.

          [1] https://www.youtube.com/watch?v=iobC5yGRWoo

      3. 1

        Resources wise and marketing I somewhat agree, JetBrains is pushing aggressively, but it’s just trying to get its foot in the door.

        But better tooling? The best Scala editor is IDEA — the same one you use for Kotlin, marketed by JetBrains, the developers of Kotlin, so it’s the same tooling! Better documentation? Where are all the Kotlin libraries (that aren’t Java) or books?

        1. 4

          Scala probably has better tooling, people just have decided to not tell anyone about it. Maybe Kotlin is overselling its stuff, but Scala is hugely underselling its stuff. Tooling nobody knows about is completely useless.

          Documentation? Just look at the website. It’s a complete trainwreck.

          • “On which platforms does Scala actually run?” – “Better not tell anyone!”
          • Downloads that just don’t work for beginners. “Oh, you don’t know what a JDK is? Too bad, no Scala for you.”
          • Install instructions which don’t reflect how 95% of Scala devs use Scala. “You followed the instructions in the documentation? Guess what, delete everything and start over!”
          • “Which IDEs support Scala” – “We won’t tell you.”
          • Glossary which is FOUR major versions out of date
          • “Tour of Scala” with gems like “Automatic Type-Dependent Closure Construction”
          • A wiki that has been completely unmaintained for the last 5 years
          • Documentation spread over roughly 5 different repos to make it extra hard for anyone to contribute
          • etc etc etc.

          Official position: “Website/documentation doesn’t need to be more beginner-friendly, because everyone already knows Scala.”

          My gut feeling is that this language is doomed.

          1. 1

            Just to be sure, is this is the website you are talking about? Because if it is, I cannot see how your first four points could be correct. That said, this debate is irrelevant, because Kotiin is new, and needs to sell itself accordingly, and Scala is over ten years old, so it doesn’t have to provide the same amount of simplicity in its getting started steps — the momentum is already there.

            1. 3

              I cannot see how your first four points could be correct

              debate is irrelevant

              it doesn’t have to provide the same amount of simplicity in its getting started steps

              This pattern of widespread denial and delusion is one of the many reasons why I left Scala, and I’m far from the only contributor having done so.

              Just a small hint: Scala on Android had a head start of half a decade and Kotlin completely obliterated it in a few months. People don’t care how old software is, but they care about how they are treated.

              1. 1

                You did not answer my questions. I reviewed your criticism for the second time and still found half of your points to be incorrect. The other half is valid though.

                Basically, your criticism is apples to oranges. I’ll explain why.

                As a language, marketing wise, Scala does not have the same problems as Kotlin – nobody uses Kotlin, except JetBrains. At least not yet. With that in mind, JetBrains is positioning Kotlin accordingly: making it as easy as possible to use. If you have IDEA installed, you can already use it. That is probably the biggest conversion factor in the language adoption.

                So therefore Scala does not need to have the same introductory experience, because it’s a production language with orders of magnitude more users than Kotlin.

                A similar comparison would be to compare the introductory experience of Java and Scala. They have a similar age difference than Scala and Kotlin (about ten years, give or take). You google “Java”, you end up at a JRE download page. You have to click an almost hidden “About Java” link on that page where you end up on generic product page, from which you have to follow “Develop Software” to a page that tells you to install JDK and NetBeans. Compare googling “Scala”. There’s a “Download” button that tells you to install either SBT, the scala executable or ScalaIDE/NetBeans/IDEA.

                The point is this: Java doesn’t need to. Everyone knows these days that you need to install a Java IDE of some sort. The IDEs will tell you to install the JDK etc.

                Conversely, Kotlin is miles ahead, because it needs to, just like Rust, Go, Clojure etc. are doing these days.

                As a language, I don’t see anything that Ceylon hasn’t solved, like Ceylon, Kotlin takes nice features from Scala and improves Java in the process. Like Ceylon, it’s somewhat better than Javaslang + Lombok (shudder), and less intimidating than Scala.

                Kotlin is a nice language and I hope to see more of it. As someone who works with JVM applications daily, it’s one of the three languages that I hope will surpass Java in popularity (the others are Clojure and Dotty, next-gen Scala).

                For what is worth, the Scala on Android story is a sad one. The language authors never really cared about it and it shows. JetBrains is also quite aggressive on that front, because they need to get anyone on board.

    2. 1

      I also think it’s unfair to leave Ceylon out of this conversation. I would personally argue that Ceylon fits just as many bills, and fits them better, as Kotlin does.

      • tooling? Ceylong has Eclipse and intellij support
      • documentation
      • it’s marketing does seem rather subdued comparatively :(
      • it’s backed by Red Hat, I don’t think resources is really a problem
      • It’s being leveraged by Red Hat produts

      https://www.ceylon-lang.org/