HNNewShowAskJobs
Built with Tanstack Start
The Origins of Scala (2009)(artima.com)
69 points by todsacerdoti 13 hours ago | 40 comments
  • Zambyte12 hours ago

    Scala was the second programming language I learned (the first was Java). I think I'm quite lucky to have picked up a language like Scala so early in my programming journey. It made it very easy for me to learn new programming languages, since it made it easy to support wildly different paradigms (which is also what makes it hard to use in an enterprise environment).

    • SOLAR_FIELDS10 hours ago |parent

      yeah, you get everything and the kitchen sink with Scala. Which is actually IMO its biggest weakness. It wants to be everything, and it isn't amazing at anything as a result.

      • tanin8 hours ago |parent

        That is why I actually like Scala. I want every tool to be available at my disposal, and I can choose what to use or not use. I want it to be reasonably succinct and type safe.

        I don't want the language to dictate how I use it. I'd prefer the language not to look out for me. There might be some, but a lot of languages look out way too much. Golang for example doesn't allow you to compile if there is an unused var. Java with private as the default.

        It is great that there is a production-ready language that differs from other languages.

      • neko-kai9 hours ago |parent

        Every significant language became multi-paradigm these days, but you can do it intentionally, like Scala, or you can do it badly.

        • SOLAR_FIELDS9 hours ago |parent

          Python is multi paradigm, but does several things really well that other ecosystems do not. Javascript as well. Java as well. What claim to fame does Scala have in this regard, aside from being the best supported language for Spark for several years before PySpark overtook it? Perhaps Akka before the boneheaded decision to paywall that ecosystem?

          • AdieuToLogic6 hours ago |parent

            >> Every significant language became multi-paradigm these days, but you can do it intentionally, like Scala, or you can do it badly.

            > Python is multi paradigm, but does several things really well that other ecosystems do not.

            Both Perl and Ruby can be, and often are, used instead of Python to great success for similar concerns. IOW, the three are often Liskov substitutable[0].

            > Javascript as well.

            You're kidding, right?

            > What claim to fame does Scala have in this regard ...

            Scala supports declarative, generative, imperative, meta, and object-oriented paradigms. All of which are supported by at least, but not limited to, the JVM and JavaScript runtimes.

            These capabilities transcend libraries (such as Akka) and/or frameworks (such as Spark).

            0 - https://en.wikipedia.org/wiki/Liskov_substitution_principle

          • mistrial98 hours ago |parent

            "Among the clients of the Spark runtime architecture, Scala is the most popular language, followed by Python and Java. According to a recent survey by Databricks, the company behind Apache Spark, 71% of respondents reported using Scala for Spark development, while Python was used by 24% and Java by 5%. Another survey by Typesafe on the Spark ecosystem revealed that 88% of respondents used Scala, 44% used Java, and 22% used Python, with the percentages reflecting multiple language usage. Scala is considered the most optimized language for Spark due to its integration with the JVM and its role as the language in which Spark was internally implemented, offering better performance and access to the latest features."

            • csto127 hours ago |parent

              When is this from? I would be shocked if in 2025 most Spark was being written in Scala

              • mistrial96 hours ago |parent

                August 2024 -- so, dated.. mea culpa https://moldstud.com/articles/p-what-programming-languages-a...

  • Rochus10 hours ago

    It's interesting that Odersky started with Modula-2 (implementing a Z80 compiler), did a PhD with Wirth, but there discovered that functional programming offered a level of theoretical rigor and mathematical elegance he missed in Wirth's imperative languages. Wirth was generally critical of the complexity and abstraction often associated with functional languages. Rather than rejecting Wirth's pragmatism, he carried it forward by attempting to make functional programming "industry-ready".

  • osdev5 hours ago

    Scala is a great language, and functional programming (not pure functional) made me a much better programmer. And functional error handling is a fantastic way to model success and failure, whether you’re using Either or the newer Result type.

    I have to both agree and disagree with some of the commenters here regarding why scala declined in usage. There are several reasons.

    1. People just got fed up with the push toward pure FP and the complexity. Pure FP and category theory, and effect libraries are just not for the average audience.

    2. Android support for Kotlin drastically reduced the momentum as well

    3. Spark usage was pretty heavy driver for using Scala and I’m not sure about it’s used as much.

    4. Scala became more and more niche as a result of item 1 above.

    This being said, I switched to Kotlin for all server side work. I think a language and in particular the ecosystem, needs the vision/stewardship that can offer more practicality and balance in the language design, programming style, tooling, and frameworks. Kotlin just became a simpler language with better support for all of the above.

    I can’t think of a better company to drive the development than Jetbrains. I don’t agree with all the choices, but Kotlin overall is a beautiful, simpler language, with all the practicality, and support needed to keep it going.

    However, now that Java is making strides in the language features, as compared to historical improvements at the VM level, I’m curious to see how the market share for Kotlin outside of android is going to be affected.

    Personally, I still prefer Kotlin for the practical FP support, Ktor as an HTTP server, and pretty good compatibility with Java. And lastly, I think there is enormous potential in multiplatform, as a strong alternative to typescript/react native for mobile.

    Disclosure: I am biased as I’m developing some libraries and soon to be made (more) public server framework.

    • mrkeen42 minutes ago |parent

      > People just got fed up with the push toward pure FP and the complexity. Pure FP and category theory

      Amen. My eyes start to glaze over whenever I read about covariance.

      It's one thing if a feature works because of category theory, but if you just "feel like arrays should be covariant", and then the actual category theorists come along and can't work with its limitations, maybe give it a miss.

    • hocuspocus4 hours ago |parent

      1. There was never a push. Functional ecosystems are simply the ones that survived. You can't blame communities that keep the language alive for doing what they want, and not what you want. Without Typelevel and ZIO where would be Scala 3's adoption today?

      2. Android has never been even remotely relevant to the space where Scala exists. And no, this was not a missed opportunity for the language. People who think Scala had a shot are completely delusional.

      3. I'm personally convinced Spark was the worst thing that happened to the ecosystem as it brought a lot of attention, and indeed, drove adoption, only to result in an incredible amount of shitty code plagued by the worst annoyances in the JVM and big data space. Spark is the biggest open source project in Scala, yet Databricks doesn't seem to give a damn about the language and couldn't even be bothered shipping a Scala 2.13 runtime for years after its release. I sincerely hope Spark moves away from the JVM entirely.

      Kotlin is really not any simpler especially with the constant feature creep that results in copying Scala features, only halfbaked. It's even less principled which is the biggest gripe against Scala having too many ways to do the same thing. There's nothing beautiful or practical about a language where people regularly write expression oriented code next to early returns.

  • osdev5 hours ago

    Martin Odersky did a fantastic job with Scala then, and also with Scala 3 IMO from a language design perspective. When I first got into Scala, I was blown away by the language features and the type system. It was the reason I got back into the JVM and the reason for getting into functional programming (not pure FP).

  • rubenvanwyk4 hours ago

    Wanted to get into enterprise-level back-end development in 2025 and was really drawn to Scala, but ultimately learning C# or Kotlin seemed way more practical.

  • wiradikusuma5 hours ago

    If you haven't checked Scala 3, give it a try. Its syntax is now Python-like (indentation based), although you can also use C style if you prefer.

    And it's faster (or maybe my laptop is faster).

  • pyrolistical8 hours ago

    I love scala case classes and pattern matching. Too bad the compiler sucked (too slow) and it had some rather large footguns like implicits

  • kasperset11 hours ago

    Have error messages improved? I remember trying it few years back but the error messages made it hard to debug. Is it due to use of JVM? Sorry for my lack of knowledge since I rarely program in JVM based languages.

    • bearforcenine40 minutes ago |parent

      Compiler error messages improved significantly with Scala 3. IIRC there was a dedicated effort with Scala 3 to improve error messages and make them more actionable. Scala 2 error messages improved somewhat over time, but can still be obtuse.

    • cerved9 hours ago |parent

      Do you mean compiler errors or some other kind of error message?

      • vvillena7 hours ago |parent

        Compiler errors got a lot better during the Scala 2.12 era.

      • kasperset7 hours ago |parent

        Yes. It might have been errors when using Apache Spark with Apache Zeppelin notebooks. However, I must admit it was long time ago (2015-2016 era).

  • awaymazdacx57 hours ago

    Disk partitioning labels: GPT, MBR, SUN, or BSD.

  • semiinfinitely10 hours ago

    Answer: some PL prof used to do a lot of java back in his day

  • ForHackernews11 hours ago

    Scala is a great language. It's a little bit disappointing that Kotlin is the JVM language that's gained so much traction instead.

    • blandflakes11 hours ago |parent

      They really obliterated their momentum with how they went about Scala 3, unfortunately.

      • hibikir7 hours ago |parent

        It was before this: It was never a huge community, but from very early on it was split thanks to some rather unfriendly, competitive personalities and very different goals. You didn't just use scala: you either ran scala with a Twitter stack, or a typesafe(now lightbend) stack, or a scalaz stack, or a cats stack, or a zip stack. And a lot of the people developing each stack didn't like each other. I've gotten to work with core contributors of multiple of those, and knowing that I wasn't a devotee of any stack led to hearing way to much complaining in pairing sessions about how The Others (TM) were slowing down the adoption of the language.

        A language that is really popular can manage having 5 ways to do things, but a small community is just going to lose steam. And the fact is, all the ways work just fine in a vacuum, but you can't just get really mature tooling when everything is just so split.

      • atbpaca9 hours ago |parent

        I don't think it is a problem with Scala 3 itself. Scala 3 brought a lot of improvements, one of them is using semantic versioning. People used to complain a log about binary compatibility between versions in 2.x. Now it's here. I think that the slow adoption of Scala 3 is mainly due to one of its most successful projects: Apache Spark. To this day, Spark only supports Scala 2.13 although Scala 3 has been around for years now. This is both disappointing and frustrating because a lot of people were introduced to Scala thanks to Apache Spark.

        • hnlmorg9 hours ago |parent

          I learned scala due to load testing with Gatling.

          I’ve always hated Java but Scala was super fun.

      • spockz11 hours ago |parent

        Why is that? I think they did a lot of things right. Offer automatic conversions, backwards and forwards compatibility from a sufficiently recent 12.x version.

        I think mostly Kotlin being simpler and Java gaining features ate the lunch. Also, software like Akka and Spark becoming less prevalent hurt because they were big reasons for devs to learn the language. Not to mention the community drama.

        The only bad thing was that it took quite long for Scala3 to become available leading to a lot of stagnation.

        • bearforcenine32 minutes ago |parent

          From my perspective the two biggest challenges of the Scala 3 migration were macros and poor tooling support.

          Macros were an experimental Scala 2 feature, but were used all over the Scala ecosystem. Because they were considered experimental a good migration story for them was never developed. That lack of support stopped migration efforts dead in their tracks at our company for a long while. It just wasn't worth contributing simultaneous support for Scala 3 and Scala 2 macros to every third party dependency who used Scala 2 macros. That said, we did it for some and lived on a fork for others.

          IDE support for Scala 3 was really rough when it first released. We checked in on it with every IntelliJ release for roughly 3 years before we decided it was far enough along. Prior to that it was rough enough that we froze migration efforts in order to keep the tooling usable enough for engineers to be productive.

      • forgetfulness9 hours ago |parent

        What really obliterated Scala’s momentum was PySpark overtaking Scala Spark coming from Python’s foothold in Data Science, columnar data warehouses carving out a big chunk of the batch processing pie as well, and then the Akka licensing change.

        The Enterprise ecosystem quickly withered away, and now only type level programming diehards remain.

        • hocuspocus4 hours ago |parent

          Akka's demise started before the license change. It's an incredible piece of software but as it turns out, not so many people need stateful cluster sharding. Modern cloud architecture and simpler streaming libraries have made the Akka toolkit irrelevant to many use cases.

          You're right about Spark and the next logical step will be removing the JVM from the equation entirely, which is already ongoing (see Photon or Comet).

      • palata9 hours ago |parent

        I remember being a big fan of Scala, and before Scala 3 it was looking to me that Kotlin was becoming a big competitor. Could that be, or do I have my timeline wrong?

    • palata9 hours ago |parent

      I was first a big fan of Scala, and while I still like it, I am now really into Kotlin.

      I don't find it disappointing: I tend to consider that Scala was an inspiration for Kotlin. Maybe Kotlin won by being simpler, and definitely because of the tooling and community: being backed by JetBrains and Google helps.

      For a long time, the tooling was very limited with Scala, which must have slowed its adoption, right?

    • dboreham10 hours ago |parent

      I've used both fairly extensively. Scala is just "too much". Kotlin is perhaps not enough, but that's better than too much.

    • 29athrowaway11 hours ago |parent

      Except when you chain many collection operations... then it breaks horribly.

      • tbct11 hours ago |parent

        Can you elaborate on what you're referring to? I can see performance becoming a problem if you repeatedly chain non-optimisable (in bytecode) as excluding the in place operations I believe all ops re-allocate the collection.

        • neko-kai9 hours ago |parent

          Just use `.iterator` before chaining and the final collection will only be allocated once.

        • ATMLOTTOBEER6 hours ago |parent

          Ignore that person they don’t know what they’re talking about lol