12 ms·
Scala 3.0.0-M1
- rethab 6y agoScala 3 is a huge change. As someone who used Scala for years, but always wondered whether they can retain their users with competition from Kotlin, I'm extremely curious what this will mean for Scala in the long run. I'm skeptical, because the cost to migrate is big. But I'm hopeful, because Scala is a language I like to write code in. Edit: why am I skeptical? I know scala 3 is largely meant to be backwards compatible. But scala has always been a language of many styles ("java without semicolon" vs "haskell compiled with scalac"). All this new syntax in scala three adds a whole new dimension to this issue.
- klysm 6y agoYeah there are certainly some Python 2/3 fears for Scala 3, but the plan and upgrade path seem much more thought out
- petre 6y agoIs there a document with the differences between 2.13 and 3?
- pjmlp 6y agoOn the JVM, I think Scala won't have any major issues it is just another guest language and isn't used to sell InteliJ licenses. Kotlin is chaining itself to Android, it will rule there thanks to Google's sponsorship, on everything else it is just yet another language to chose from with a weaker eco-system, used to sell InteliJ licenses.
- dtech 6y agoKotlin has significant support from the largest Java ecosystem: Spring. In my experience it's also much more compatible with Java/JVM libraries. In Scala that's perfectly possible but leads to very un-idiomatic code, in Kotlin you barely notice.
- cies 6y agoScala has an issue with the concept of "idiomatic code". I'd say when it comes to "idiomatic code", Go and Scala are at the opposite sides of the spectrum.
- pjmlp 6y agoSpring supports everything that helps their bottom line. Where are the Groovy, Scala, Clojure support nowadays?
- imtringued 6y agoGroovy is still alive within the context of Grails (which is basically a very nice wrapper around Spring) and Micronaut (which is a direct competitor to Spring). Micronaut officially supports Java and Kotlin as well.
- pjmlp 6y agoI was referring to the way Spring used to sell that they supported those languages, just like they do with Kotlin now.
- lmm 6y ago> In my experience it's also much more compatible with Java/JVM libraries. In Scala that's perfectly possible but leads to very un-idiomatic code, in Kotlin you barely notice. I think that's actually reversing as Kotlin and Java diverge. E.g. interop with Java Optionals is very easy in Scala (and they obviously correspond directly to Scala Options) whereas it's harder to make them fit with Kotlin nullable types. And Kotlin's "suspend functions" are unlike anything else and mean you have to understand a concept of "inline" that changes the semantics of the function it applies to; e.g. calling a Java function that takes a callback from an async function is straightforward in Scala, but not so much in Kotlin.
- jillesvangurp 6y agoThe crucial point here is if Scala 3 maintains backwards compatibility with Scala 2.x. If not, it's effectively a new language and then the game becomes which of the existing scala code bases will switch over and when. There's a large amount of existing Scala code out there and embarking on a migration of that stuff is going to take very long. We're talking many years here potentially. The few Scala projects I've dealt with, even updating to minor releases of Scala was a big deal. The python 2 to 3 transition took well over a decade. You have similar discussions in what remains of the Perl community around v5 and v6. IMHO what Oracle has been doing with Java in recent years is impressive in the sense that they provide a credible upgrade path and put a lot of effort into that while still adding non trivial new language features. But it has a price of added complexity or compromises with new features and unfortunate legacy features that are not going to way. Javascript and typescript have the same issue. Javascript has a lot of weird legacy features and typescript preserves backward compatibility with that weirdness and attempts to engineers around that. I'm currently using Kotlin across Android and Server (mostly) with an intention to also use it on IOS and Web very soon. Its multi-platform capability is increasingly a good selling point and I love how that ecosystem is booming in the last year/months. I'm definitely an early adopter of multi-platform but this seems to be one of those things where it seems like a bet worth making at this point. Kotlin is of course a much younger language so it does not have a lot of legacy yet burdening it. Yet, Jetbrains seems to be good at managing new features while minimizing disruption, dealing with necessary deprecations, and generally not breaking compatibility. Their experience as tool makers gives them a unique edge over a lot of other languages. Arguably Kotlin emerged as a rejection of Scala to replace Java by Jetbrains: they considered it and dismissed it as an option and then embarked on a journey to create their own language. I think the success of the language (relative to Scala) seems to indicate that that wasn't a bad choice. Scala intended to do many of the same things but it just never caught on with people actually doing those things to the extent that Kotlin seems to be catching on. The transition from Java to Kotlin is a lot less of a hard sell than the transition to Scala was. Though I know plenty of people that stubbornly stick with Java still. Of course early adoption in the Android community was a big deal. But then you could argue that that same opportunity was there for Scala to take and I don't think much serious effort ever was put in that notion. The need for something else than Java was quite big there and a big driver for this. All Kotlin did was provide a credible upgrade path to Java developers and the Android community jumped on it because it was easy to switch and obviously better. You see the same happening in the Spring community which is increasingly Kotlin centric. Meanwhile Scala seems to be bleeding mind-share to more pure (for lack of a better word) languages Crystal, Elixir, etc. or more system oriented languages like Rust, or indeed Kotlin. It's a bit of a repeat of what happened to the Ruby community a few years ago. Certain types of people were very passionate about that language for a while and then moved on.
- aliakhtar 6y agoI have a pretty large codebase written in scala 2.12 or so (whatever the version was around late 2018). I'd like to migrate it to scala 3. Any ideas how hard it'll be?
- dtech 6y agoStart with migrating to scala 2.13, scala 3 can run all non-macro 2.13 code that doesn't emit deprecation warnings and can consume most 2.13 libraries. The widely-used ones it can't will get updated. For more information see https://scalacenter.github.io/scala-3-migration-guide/docs/compatibility.html https://scalacenter.github.io/scala-3-migration-guide/docs/c...
- lmm 6y agoPretty easy unless you were writing custom collections or custom macros, IME.
- AheadOfTime295 6y agoScala 3 supports braceless syntax, aka significant indentation, aka "YAML is to JSON as Scala 3 is to Scala 2" https://dotty.epfl.ch/docs/reference/other-new-features/indentation.html https://dotty.epfl.ch/docs/reference/other-new-features/inde... There was quite some debate on this, going on strong.
- silon42 6y agoYuck... personally I'd want a Lint that would disallow many such syntax differences from Java: - force use of () - force use of ; - etc...
- cryptos 6y agoI consider this a totally useless "innovation"! As if Scala didn't have already enough possibilities to express things, no we are able to leave out braces, what makes scanning code even harder and will lead to an ugly mixture. I would accept it, if they would decide to drop the traditional syntax. But adding yet another style, just for the sake of it, is waste of resources (of the Scala creators and Scala users). There is a good article about the "strangeness budget" of languages, and I think that Scala doesn't spend it wisely. https://steveklabnik.com/writing/the-language-strangeness-budget https://steveklabnik.com/writing/the-language-strangeness-bu...
- smabie 6y agoI've always loved Scala and Scala 3 is shaping up to be extremely exciting. Love the new ADTs and braceless syntax: really gives the language a cleaner and more ML inspired feel. No other conventional language (including OCaml, F#, etc) seem to have the effortless kind of power Scala does. The combination of the extremely powerful type system with the "OOFP" paradigm is a great combination. OOFP is such a great paradigm and it's unfortunate that no other language has embraced it. It's ironic that I love Scala so much because I don't particularly enjoy dealing with the JVM and all its complexities and problem. But Scala is so good that it mostly makes up for it. Scala does get a lot of hate (especially around here), but I've never really understood why. There's only one language I like more (kdb+/q), but that's a hard sell, especially because of the cost. Too bad there's not really a ML/AI ecosystem around (besides Spark, which seems to be losing favor partially because of its embarrassing performance), because using Python is such a drag. However, I do understand why non-CS/type theory people might find the language intimidating. But to that I'd say, I've seen new junior (though very smart) developers with no Scala or FP experience get onboarded and write idiomatic Scala code within a couple weeks to a month. The short term cost is more than worth it considering the absurd productivity compared to Java/Kotlin/Python/blublang. Compared to OCaml/F#/Haskell, the improvement is a little less stark, though still clear imo (especially when considering editor tooling and available packages).
- TeeWEE 6y agoFor me scala's feature set is absurdly big and there are always 10 ways todo things. Look at the spec of Scala. Its 200 pages long. That's insane. I'd rather use Kotlin.
- alexashka 6y agoJust want to give Martin Odersky a shout out - what a legend this guy. 62 years old, going strong. I'm not even in the java ecosystem but Scala strikes me as the most likely language to do something fresh and interesting on top of an existing ecosystem in the next few years, which is terrific news.
- trumpeta 6y agoThere are many reasons why I respect him, but the fact that he laid out a time plan for Scala 3 already 2 years ago and then kept the timeline is mind-boggling.
- pjmlp 6y agoNice to see Scala 3 finally making the first steps to release.
- blackoil 6y agoIn my company (10k+ devs) Scala seems to be losing steam. All the enthusiasts have moved to Go/Rust, while the pragmatics are staying in (moving back) in Java. No new major project is being built in Scala. Does anyone share this experience?
- hamandcheese 6y agoMedium company (low hundreds of devs). My team is starting some new projects in Scala, which will be the first Scala at the company. So far it’s going okay. But I personally am surprised at how disinterested most folks are in learning anything new.
- LandR 6y ago> am surprised at how disinterested most folks are in learning anything new. same here, we don't do Scala but it's basically impossible to get people here to learn something new. Introducing a new language (like Scala,F# etc) would be impossible.
- zaphirplane 6y agoWhy did your team choose Scala , assuming you are bound to the jvm what sold Scala over kotlin or Java.
- hamandcheese 6y agoThe tl;dr is we had absolutely no good business reason to choose Scala, and very few technical reasons. It is mostly a developer happiness gamble. A secret ulterior motive of mine was that Scala has bad support for Spring. Every other Java service at the company uses Spring, and I abhor it, so if I can drive adoption of Scala on my team then we can avoid Spring and also provide pressure to make all our shared JVM libs Spring-agnostic (which I believe is a good move in general).
- fnord123 6y agoSame experience here. JDK11 and beyond added some more enthusiasm to base Java. If Loom lands I think a lot of people will also lose interest in Kotlin as well (because AIUI a big draw for Kotlin is the async story).
- deleted 6y ago[deleted]
- AheadOfTime295 6y agoScala 3 making progress is great, just like progress on the Scala 2.13 camp: Scala on Track to Support Java 9 Module System https://github.com/scala/scala-dev/issues/529 https://github.com/scala/scala-dev/issues/529 Scala 2.13 on track to support Spark https://issues.apache.org/jira/browse/SPARK-25075 https://issues.apache.org/jira/browse/SPARK-25075
- osdev 6y agoThe Scala language is great but the ecosystem sacrifices simplicity for pure FP. Scala has always suffered from complexity problems due to libraries. For example, using Http/JSON/Database libraries have always been a lot harder than they need to be due to a die hard approach to pure FP. Scala 3 looks pretty good, but I just can NOT see myself using Scala again, after having worked with it for 4-5 years at work and on personal projects. I write mostly/reasonably FP code without using Cats/Category theory. I’ve recently moved all my code from Scala to Kotlin and I’m loving it, found the perfect balance with Kotlin.
- edem 6y agoSame here. Kotlin is a pragmatic language and it is a much better fit for the "Turbo Java" role that Scala originally wanted to do.
- hocuspocus 6y ago> For example, using Http/JSON/Database libraries have always been a lot harder than they need to be due to a die hard approach to pure FP. Hu? There are plenty of alternatives to the pure FP ecosystem. HTTP: Dispatch, Requests-Scala, literally any Java client if that's still too FP for you JSON: uPickle, Play JSON, or simply Jackson DB: ScalikeJDBC. Quill and Slick do a lot more but are not particularly die-hard FP either.
- jatcwang 6y agoVery, very excited about Scala 3. Here are some of the things I'm looking forward to using: * Generally a more clean language for everyday use, codifying existing patterns like newtypes (opaque types), typeclass derivation and extension methods * Improved type inference & lots of other quality of life improvements * A macro system based on the idea of multi-stage programming. This has a lot of potential for improving both type-safety and performance. An example: beating existing database systems query optimization with ~500 lines of Scala code [1] * TASTY, a new intermediate representation (AST) for artifacts. This means that Scala will have a much better version upgrade / binary compatibility story in the future. (e.g. TASTY is used for facilitating 2.13 <-> 3.0 bi-direction upgrade!) * Significant compile time improvements over Scala2 alraedy[2] (and we're only at M1 release)! Scala has already been a wonderful language to work with professionally with many great tooling (linting, automatic migration, 2 good OSS IDEs), and I think Scala 3 will certainly push the state-of-the-art forward in many departments in the coming years. [1]:https://www.cs.purdue.edu/homes/rompf/papers/rompf-icfp15.pdf https://www.cs.purdue.edu/homes/rompf/papers/rompf-icfp15.pd... [2]: https://twitter.com/not_xuwei_k/status/1323643312230772737 https://twitter.com/not_xuwei_k/status/1323643312230772737
- esarbe 6y agoNice. Looking forward to start using all the 'intention over mechanism' features that Dotty introduced.
- edem 6y agoThe most important thing that no one seems to mention is that Scala 3 is not compatible with Scala 2. This means that they are creating competition for themselves. It is the Python 2 vs 3 problem all over again.
- hbogert 6y agoI never quite got what made python 2 -> 3 so much more complicated than say php 5 to 7. I heard nobody complain the time I was still active in the PHP world (lucky me right?). Yet the Python2 code just kept lingering everywhere.
- x87678r 6y agoScala can be nice but up until now compilation is way too slow to live with. Hopefully this will make it more palatable, but I've moved to Kotlin already.
- esarbe 6y agoI've been working with Scala for 7 years now. Compilation speeds have been getting better throughout the 2.12.x/2.13.x cycles. Compilation speeds for Scala 3 are looking very good too.
- ph2082 6y agoI have downloaded this big open source project which uses spring and ibatis and have everything which OOP offers. For learning Scala, I am trying to re-write it using play framework. Case classes do offer reduction in boiler plate code. But write now feeling overwhelmed about how to map all this deep inheritance tree, factories etc. from OOP world to functional way of doing things. I hope someone write side by side mapping of doing things in Scala 2 vs Scala 3.