16 ms·
The Road to Scala 3
- maxaf 7y agoWhen I gave up on Scala in 2016, I did so because its future looked fragmented and uncertain. Fast forward more than three years, and the first release of Scala 3 won’t be out until another year from now. Compare this with the pace of development of Go or Rust: those languages are driven by a vision, and have a dedicated team behind them. Scala is declining because no one could figure out for the longest time what was next and how to work on it. It’s too bad, as Scala did the most of any language to bring me into the fold of statically typed programming. I miss it sometimes, but then I remember all the times Scala wasted my time, and get back to writing Go like a happy little camper.
- haggy 7y ago> Scala is declining And the proof of this is... Where?
- maxaf 7y agoI won’t even mention the anecdata from my own workplace. I’ll only say that within my extended network people are frantically rewriting Scala bits in other languages. Those who are stuck with it (because of, say, extensive prior investment into Spark) are scrambling to come up with alternate solutions. Put your ear to the ground, and you too will hear it.
- dominotw 7y ago> rewriting Scala bits in other languages. My employer is doing the same.
- xvilka 7y agoThere is an ongoing work on creating Spark alternative in Rust[1][2]. Hopefully, that could help. [1] https://github.com/rajasekarv/native_spark https://github.com/rajasekarv/native_spark [2] https://medium.com/@rajasekar3eg/fastspark-a-new-fast-native-implementation-of-spark-from-scratch-368373a29a5c https://medium.com/@rajasekar3eg/fastspark-a-new-fast-native...
- pkolaczk 7y agoWill take years to get there, if they even get there at all. This is a single-man side project now. Also benchmarking something that has 1/100 of the original functionality and is not production ready is very unfair. It is much easier to get a specialized use case faster than a general purpose system.
- playing_colours 7y agoHe is not the first, Andy Grove worked on a similar thing last years, but he worked mostly alone, and without community you cannot take off such ambitious project: https://andygrove.io/2018/11/datafusion-2019/ https://andygrove.io/2018/11/datafusion-2019/
- yahyaheee 7y agoUsed to write scala, what a mess looking back on it now. Everyone I know that was writing it is now writing Go/Kotlin/Elixer
- continuational 7y agoSounds a bit like they just like to try out new languages.
- yahyaheee 7y agoExcept they have all stuck with those languages, Scala was a disaster to maintain which is why you see companies fleeing from it.
- giggles_giggles 7y agoI'll speak for myself. I just jumped ship from a Scala team and took a pay hit to get out because it was so horrible. No one on the team had a strong command of the language, which made it worse. The application was a ball of mud. The week I left, proposals to rewrite everything in Java were heard. I took a position on a Go team and am much happier.
- wirrbel 7y agoI wouldn't jump ship to a Go project, but I am currently in the situation you fled from. Even the core team who started the project doesn't have command of the language. I have some experience with rust and Haskell (hobby) and JVM experience with Java and clojure so I can get by but it is not pleasant. I think the situation is similar to c++ where too many features have been added over time. While with c++ there is a body of compiled recommendations on what not to use and how to write c++, for scala that doesn't really exist.
- pkolaczk 7y agoThis has nothing to do with languages. I saw the same happening in a company writing pure Java, JS or Python. Doing a project with people who don't have command of whatever stack they are using is asking for trouble. On the flip side, Scala can be a very pleasant stack to work with if you have right people on the team. > While with c++ there is a body of compiled recommendations on what not to use and how to write c++, for scala that doesn't really exist. Principle of least power is what you need.
- sideeffffect 7y ago> for scala that doesn't really exist https://nrinaudo.github.io/scala-best-practices/ https://nrinaudo.github.io/scala-best-practices/
- coldtea 7y agoSometimes you need no proof, just to look around well enough. Not everything is a science paper.
- hocuspocus 7y agoWhen I look around, I see more jobs, conferences, talks, meetups, libraries, open source communities ... Sure, some companies are moving to other languages, that might be growing quicker than Scala ever was. But this isn't zero-sum.
- The_rationalist 7y agoWhat about kotlin?
- worldsayshi 7y agoYes, Kotlin seems to me like the future of Java.
- dmit 7y agoKotlin is not the future of anything. They got the Android boost and still, two years later, all they have to offer is a molasses-slow improvement pace and a shitty dev experience in their signature IDE (which also happens to be made by the same company). Last time I tried to create a Kotlin project in IDEA, it couldn't provide type information on hover. The Kotlin dialect of Gradle was barely supported enough to be called a "third-class citizen". It's super embarrassing.
- deleted 7y ago[deleted]
- EdwardDiego 7y agoWe're writing new apps in Kotlin instead of Java, works fine for us. shrug Vert.x , Ktor apps, Kafka streaming apps. IDEA handles it absolutely fine these days, I suspect you last tried it sometime ago. Can't comment on the Gradle stuff though, I vastly prefer Maven.
- The_rationalist 7y agoIs vertx better than ktor for production?
- EdwardDiego 7y agoVert.x is doing us well for high volume apps, Ktor is early stages but looks alright also. That said, haven't benchmarked identically feature compete implementations of the same app in both, so don't really have the metrics to properly compare, but so far at least, it seems comparable.
- continuational 7y agoGo is just barely statically typed though, with its lack of generics. Some day soon, it will tacked onto the language; a language that wasn't designed with that in mind. I don't know about pace, but in absolute terms, Go is far behind even the oldest versions of Scala.
- yahyaheee 7y agoThat would be missing the point of Go. It’s not as though the Go team is incapable of introducing genetics they just took a hard line on not putting anything into the language that wasn’t absolutely needed. This built a simpler language and because of that a stronger community, which is why Go has all but entirely eaten scalas lunch
- continuational 7y agoThe marketing is very impressive indeed, I won't argue against that. I can only think of Angular 1.0 as an equally impressive feat of advertising (I totally bought into that - for a while). But logically, what you suggest implies that either generics aren't absolutely needed, and shouldn't be in Go, or it's absolutely needed, and Go has been lacking them for a long time.
- yahyaheee 7y agono it just implies the don't willy nilly throw in any feature into the language like Scala, and I am incredibly grateful for it after writing Scala for a couple years, what a mess
- playing_colours 7y agoScala tends to be more of a kitchen sink, kind of an academic experiment brought to industry, whereas Go is way too far down the path of having only “absolutely needed” features - they promoted it as a “pragmatic, boring” language to focus on your business and write consistent code. As a result, this approach makes the language less expressive, really boring for many engineers, and also, unfortunately, it brought some bad practices - repetitions, error handling from last century, etc. Languages are in a big part matter of tastes, and it does not make sense to criticize their chosen approaches beyond objective technical merits for your tasks.
- esarbe 7y agoIs it declining? Citation needed? I agree that Scala is not the new kid on the block anymore but I don't see it decline. When you look at the language rankings of the last few years, Scala seems to have settled at about ~12th place currently.
- Thaxll 7y agoScala is nowhere near the first 20.
- pkolaczk 7y agoDepends on the criteria and the group of companies you survey. In our customer survey done mostly among top 100 enterprises it comes at #3 very close to Python (which is #2), and it is much stronger in absolute numbers than C# or JS. And the trend is growing. Of course, this is not representative to the whole market and heavily biased towards big companies with big backends that need to scale, but neither are Tiobe, GitHub or SO rankings.
- yahyaheee 7y agoLove all the Scala fanboys on here downvoting anything to do with Go being better. Run Scala in prod for a couple years then run Go in prod for a couple years and tell me with a straight face what makes more sense. Scala was such a massive waste of time :)
- bcherny 7y agoI really love Scala, but I worry about its future given Google putting its weight behind Kotlin, and the two offering a lot of the same features and philosophy. Does anyone know if the Scala maintainers have addressed this directly?
- xvilka 7y agoKotlin wins also because it has a stable and usable Native flavor. Scala Native is a third-party project and seems dead, while Kotlin Native is the core part of the Kotlin language and being developed at a fast pace.
- vips7L 7y agoI don't think this is relevant since both languages compile to JVM bytecode and Graal can compile that to native.
- pjmlp 7y agoKotlin/Native is not semantic compatible with Kotlin code written for the JVM without any regard for other platform's existence. Then there is the total lack of access to the huge JVM eco-system, a less performant automatic memory system, and AOT playing catchup with AOT/JIT tooling available for the JVM, some of which with battlefield experience in production since the early 2000's. And then there is the whole thing that JetBrains gladly sells CLion licenses for the whole development experience with Kotlin/Native.
- hocuspocus 7y ago* If you use even half of Scala's functional capabilities, Kotlin isn't really an alternative. * What Google does with Kotlin and Android is completely irrelevant to the Scala ecosystem and its users. * On the back-end side, Kotlin doesn't intersect that much with Scala. I haven't met anyone migrating from say, Play to Spring thanks to Kotlin's support. * In the big data world, if you rely heavily on Spark, Scala is still the preferred option on the JVM. Python is a much bigger threat there. * Lightbend and the Scala center have been seriously working on tooling, which is the biggest issue to address compared to Kotlin (Jetbrains has a huge advantage here).
- dominotw 7y agoI switched to clojure for a new job from doing scala for 5 years. I just feel a weight has been lifted off of my head. Weight of syntax, slow compilation, weight of implicits ( some of them are so bad even editors like idea couldn't figure out what is going on). And most importantly the weight of the constant feeling of not being able to fully understand the meaning of endless math terms thrown at me casually like monads, freemonads, applicatives , categories, Kleisli ect. I spent so much time learning what all these math concepts apply in programming but now I don't remember what any of these mean anymore and I am still shipping production applications ( in clojure). Sigh, what a waste of my life doing scala :( .
- leetrout 7y agoThis touches on a difference between the Go and Scala communities and courses from my very brief experience learning scala for work the past couple months. The older I get the more I want things that are explicit and easy to understand. Tons of sites and videos and blogs exist that break down the features of Go without a ton of math lingo. I never see Scala materials free of that. Even when I agree that I need to understand the terms of art I haven’t been in a math class in 16 years and it’s slow going. With Go I was productive in two days and proficient in less than two weeks. Yes I still shoot myself in the foot with channels and race conditions when I’m rushing but at least it’s a super fast compile cycle to iterate and my IDE doesn’t require over 2gb ram like scala / idea does.
- yahyaheee 7y agoYup being easy to understand without lacking functionality is definitely superior to supporting every insane programming concept. It builds stronger communities and better software
- jkachmar 7y agoBig ol’ “Citation Needed” on this one. The flip-side here is that a language that doesn’t support basic programming language theory concepts dooms its users to repeat the mistakes of those who discovered them. I also would personally disagree that any statically types language without generic types and without non-nullability (e.g. `Option`/`Maybe` and `Result`/`Either`) is severely lacking in the ability to express programs that are easy to understand.
- idclip 7y agoThe problem with scala is that the docs were too late to come. Those who put them out are geniuses (props Cats ppl, ZIO too) - but it seems it is now too late. You know there’s irony that alot of the earlier docs were based on haskell books, too. Its not the math. Look at haskell’s freenode presense vs scala’s. Scala’s a 6th of haskell. What haskell had over scala is docs and community. Scala was just too late, and my coworkers are all whispering Kotlin. It’s a real shame. Irony edit: i actually maintain a scala codebase at work, one of two under thirty other devs who do, and me and one of the major players in the team were talking about this only two days ago. Sort of a sad kind of funny.
- stewbrew 7y agoThe problem with scala is that academic goals sometimes don't align too well with "industry needs".
- hocuspocus 7y agoThat's a complete myth, really. The Scala ecosystem has its fair share of problems, but Odersky and his lab's involvement and stewardship have never been one of them.
- stewbrew 7y agoJust an example: Why wasn't it a priority to make scala run well on dalvik? The place is taken by kotlin and is one of its strongest selling points.
- hocuspocus 7y agoBecause there never was a real demand for it? What does that have to do with Scala's academic roots? And what makes you think Scala needs Android to be successful? Android is completely irrelevant to most Java developers.
- oxnrtr 7y agoCore team didn't care about Android. Simple as that. :-)
- aganame 7y agoI'm sorry to be this negative, but I sincerely believe Scala to be the worst seriously used programming language of modern times. It should just end.
- sgt 7y agoWhy? This seems to be an uncommon opinion.
- noelwelsh 7y agoThis is fantastic. Scala 3 is a huge improvement, doing away with main of the pain points of Scala 2 and making using Scala effectively much more straightforward. I'm looking forward to getting to work with Dotty / Scala 3.
- playing_colours 7y agoI’m looking forward to reading new books on Dotty from underscore then :)
- jacobn 7y agoI love scala, and am very much looking forward to scala 3. For all the complaints about the language that always pop up in these threads: yes, the language lets you shoot yourself in the foot (with great power comes people who don’t apply it responsibly), but it’s precisely that power that makes it so useful and exceptional when judiciously applied. I like to say that scala is as if java and ruby had a love child and it all worked out. Unfortunately, that does mean that java people will feel it’s too fast & loose, and the ruby people will feel stymied by its static typing. But I just love that where other statically typed languages generally say “no”, scala says “well, I trust you know what you’re doing...”. The only substantive tool complaint I have these days isn’t with compiler speed - it chugs through the codebase plenty fast - but with tool startup time. Hopefully the more recent java versions and maybe some native packaging will eventually help with that.
- asimpletune 7y agoI appreciate you taking the courage to share your honest thoughts despite how they may conflict with the views of others here. My heart goes out to the people I overhear at work, the ones who are struggling the most, lamenting and complaining that tool X (In this case scala) is “so” embarrassingly awful and, with the implication that it’s to blame for their poor performance. That sentiment resembles some of the comments that I’ve written here and my heart really bleeds for them, because I know these people at work and I know that they’re struggling and I also know that they’re good, smart people, who have just fell into a trap of justification. For what it’s worth, in my own journey learning Scala, I simply didn’t have the luxury to blame, and I just forced myself to try and figure out how other people, like the finagle team for example, could be so productive with such an obviously newfangled invention, until I realized… I was wrong. Scala is actually a wonderful language! People move companies to continue working in Scala! In fact the ideas and lessons that I’ve learned from rethinking how I used to do things are so unfathomably valuable to me that I don’t think I will ever look at code the same way again. And before you downvote me please don’t mistake my words for criticism. I truly empathize with how some of the people here may feel and I’m very happy to go into specifics if anyone requests that. I don’t write on HN a lot because a lot of times I think there is just this therapy - or a version of therapy - that amounts to people reinforcing their need to blame things in order to continue excusing the poor performance, and I don’t want to get caught up in it or be made to feel bad for encouraging others to reconsider their virtues. And by the way we all, at times, have poor performance. (Anyway, I dictated this into my phone, so also excuse any weird words or punctuation. I love you all. Some typos were subsequently edited)
- melling 7y agoI see a lot of people complaining about Scala. I looked into it 9 years ago but it didn’t seem to be gaining traction so I stopped playing with it: https://github.com/melling/scala https://github.com/melling/scala Recently, however, I’ve noticed that Scala does to be be quite alive (3.0, ScalaDays, Cats, Shapeless, Scala.js) so I’m taking another crack at it. I’ve done a lot in Swift and it’s my current favorite language, but it’s not widely supported. When I look at Scala (especially 3.x), I feel like it’s like a Swift++. Go is a great language but I want to move up a level of abstraction. By the way, Scala 3 is now feature complete: https://www.reddit.com/r/programming/comments/edcenz/dotty_scala_3_feature_complete/ https://www.reddit.com/r/programming/comments/edcenz/dotty_s...
- saagarjha 7y agoSwift seems to have taken a number of its early ideas from Scala, particularly around some of its functional concepts.
- lihaoyi 7y agoThe way I look at modern Scala is a mix of Python and Java. Do it badly, and you end up with the unmaintainability of Python and the clunkiness of Java. Awful. Do it well, and you end up with the convenience and interactivity of Python and the typesafety, performance, and toolability of Java. This lets you implement your code quickly the first time, and have it run blazing fast on a hot JVM, with the compiler having your back as you grow your codebase in size and complexity. Sure beats trying to prototype in Java, or porting half your Python prototype to C when you realize it’s too slow. Scala has a bad reputation, well-earned due to an early culture of crazy experiments, crazy operators, and crazy tools. But those days are behind us. You can no longer get stuff into the standard library “just because”, and a lot of the early experiments in that category (xml, parallel collections, parser combinators) has been consciously moved out. Operator-heavy tools like SBT have largely replaced the crazy operators, while operator-heavy libraries like Dispatch have been largely replaced by less-operator-heavy equivalents. SBT used to be awful, but it’s improved a lot. And you don’t need to use it: I haven’t touched an SBT build in years by now, in both OSS and proprietary contexts. There remains a lot of different ways to write Scala, more than most languages, but you don’t need to write Haskell-in-Scala unless you really want to. I’m personally very happy with my Python-like language with Python-like libraries, with static typing for maintainability, orders of magnitude better runtime performance, excellent parallelism and concurrency, one of the best compile-to-JS experiences in the world, and the best tooling (IDEs, profilers, monitoring, etc.) on the market. As someone who maintains optimized programming language interpreters, distributed backend clusters, three-tier web apps, command-line tools, and many other things on a daily basis, I appreciate being able to do all this in one language rather than juggling 5 different languages (and 5 different sets of libraries, and 5 different sets of tools, ...) to satisfy each use case. Scala may be diverse and fragmented, but it’s not as diverse or fragmented as the polyglot Python/Ruby/C/Go/Javascript codebase it would likely take to replace Scala for my daily work
- nullspace 7y ago> I’m personally very happy with my Python-like language with Python-like libraries, with static typing for maintainability, orders of magnitude better runtime performance, excellent parallelism and concurrency, one of the best compile-to-JS experiences in the world, and the best tooling (IDEs, profilers, monitoring, etc.) on the market. Hey lihaoyi, completely agree with you on this. (Coming from someone who recently stopped writing scala). That said, in my opinion, if you got to write “python-like scala” with static typing and hof on a regular basis, you should count yourself as one of the lucky ones. In the context of a diverse team, with interests and experiences ranging from Java to Js to python To all the way to Idris, how would you reconcile how different team members want to write Scala? What I’ve seen this lead to is just because you understand one portion of the codebase, doesn’t mean you can understand another one (both on similar levels of domain complexity), and just because intellij works great on one module, doesn’t mean it’s going to work at all in another one. EDIT: and I have to say, I love your contributions to Scala library ecosystem, and have used many of them. :) they really do reflect the simplicity of python-like scala.
- solicode 7y agoI often see comparisons to Go, Kotlin, Rust, etc, and I agree that it's unlikely for Scala to have a second renaissance and have an steep upward trajectory like those languages, but is that really a death of a language? I'm actually fine with Scala narrowing its scope and focus at being really good at just a couple of things. Such as embracing its FP-side more so than its OO-side. Not to say there is no value in its OO-side (I still see some value there mostly pertaining to modules). But I just mean that not every language needs to aim to be a top 5 language. FP and advanced type systems still seems to alienate a significant percentage of programmers for various reasons. That's fine. It's not like that sentiment is going to change overnight. Scala missed its opportunity with Android. I think you just have to concede that to Kotlin at this point and just focus on moving in a direction that is not occupied. Which is why I mention FP with a strong focus on types. There's not much competition there besides Haskell. And since Haskell for the JVM will likely never be a thing (a few have tried, but none have gained traction), Scala is still there. And with the direction Scala 3 is going and all the improvements it brings, it's actually looking quite positive. At least in my eyes. And besides, I don't think Scala has to be a "worse Haskell" in everything that it does. I think ZIO is a good example of a great Scala library that actually resulted in something really special by embracing what Scala can do: https://zio.dev https://zio.dev
- melling 7y agoWhat is the story with Scala on Android? Years ago I thought it was a matter of using too much memory. There’s not much talk about it but it does seem to be possible: https://scala-android.org/ https://scala-android.org/ Will Scala 3 help?
- solicode 7y agoI don't know the whole story. Perhaps somebody who knows can chime in. But my impression is that Android being stuck basically on pre-Java 8 at the time while Scala relying heavily on Java 8 features was one complication. Scala generating a bunch of class files for lambdas and so on with no SAM types + invokedynamic to reduce all that plus strange DEX limitations might have caused issues. Plus memory limitations like you said. I'm not sure there are any real blockers for Scala on Android anymore. I imagine it's mostly a resource problem now. With Kotlin's momentum in that space though, I'm not sure too many people are calling for it anymore. Who knows though, maybe after Scala 3 is finally out the door priorities could shift.
- deleted 7y ago[deleted]
- sgt 7y agoThe more I read about Scala it makes me wonder why (1) I am not using it (or my team) (2) Java teams across the world are not at least seriously considering changing to Scala. It seems likes it's miles ahead of both Java and even Kotlin.
- lightbendover 7y agoHaving led engineering at a startup that developed ~95% of our code in Scala and then moving to a FANG team that developed most of its services in Java (still using Spark Scala to a large degree and beginning to introduce Kotlin), these are the reasons I can use to justify using Java over either: 1) it is already there, 2) most engineers know Java well [enough], 3) other teams predominantly use Java and it makes certain types of code sharing more streamlined. I'm assuming most Java shops have existing tooling that will lock them into the JVM no matter what. That's fine, the JVM is incredible. Kotlin can be introduced very easily into most Java codebases as interoperability is a tenet. Scala not so much. Holistic interop between Scala and Java can fill an entire intermediate-level book. At the startup, we had a difficult time hiring for Scala. A number of candidates we moved forward with who were well-versed in it wanted to explore the language and embrace the FP aspects, which led to incomprehensible code for the engineers used to procedural OOO. In full retrospect, this was an issue with our hiring standard; Scala should not have been a specific part of our bar. It was a startup, we had crushing customer demands, there was no time to teach every engineer what an IO Monad was. It was a constant battle and perhaps the most frustrating aspect to me leading all the way up to acquisition. None of these issues would have existed if we chose e.g. Go; we would have quickly found a team of engineers who wanted to build applications instead of tinkering with the language. To me, that's the best part about Go -- it's boring. Java is another boring language, but it's also a very verbose one, even when fully utilizing Lombok/G-libraries/etc.. Kotlin fixes the verbosity issue to a large enough degree for my needs without introducing enough interesting features to attract those darn academic types. To me, Kotlin is about as good as a language can get while remaining on the current iteration of the JVM. We have been slowly introducing Kotlin and plan to use it for most new non-Spark-related projects. I would only consider Scala for the same purpose if 1) interop was trivial to the degree that Kotlin's is, and 2) it was reduced to a reasonable subset of its full complexity. I believe the right steps are being taken with the language, but it still has a ways to go in those regards.
- walkingolof 7y agoFor anyone curious about Scala 3 and its new significant indentation syntax, I wrote a small Scala 3 project which also uses Graal native-image. https://github.com/olofwalker/ting https://github.com/olofwalker/ting
- yahyaheee 7y agoScala is dead for anything that isn't academic. They didn't listen to their customers and ultimately burnt them. Every company I know that was using Scala is running pretty much running any other direction now. It was an interesting experiment I guess.
- pinopinopino 7y agoI love Scala, it has a nicely advance static type system, supports functional programming and has even macros, although they are a bit messy. Something I miss in go and python. Go's type system is way to simple and python is dynamic, which I think is unnecessary these days. Static type systems can be as expressive as dynamic ones. It has interesting libraries, like cats, shapeless, breeze. And it is popular in the big data field.
- esarbe 7y agoYeah, the thing with macros is that they were never officially supported. They were always kind of a hack. Scala 3 finally has an answer for that[1]. Besides that; yeah, Scala is amazing. I really see it shine for scientific computing when it moves beyond Python. [1] https://dotty.epfl.ch/docs/reference/metaprogramming/macros.html https://dotty.epfl.ch/docs/reference/metaprogramming/macros....
- pinopinopino 7y agoIt looks much cleaner and pleasant to use. Perhaps time to play around a little bit with dotty.
- jatcwang 7y agoI was initially skeptical of Scala when I landed my first Scala gig a few years ago, but now I'm really glad I picked it. Simple things like pattern matching and immutability are amazing, and Implicits + Macros enables some awesome libraries like Shapeless[1], Chimney[2] which solves real business problems in a succinct and type-safe way. Very excited about what's coming in Scala 3 * Lots of improvements to make the language simpler and easier to work with * Integrating some tried-and-true patterns from the current Scala ecosystem directly into the language * First-class tooling to solve some long-standing issues in the ecosystem (binary compatibility) The team behind Scala 3 has done a tremendous job. Along with the whole movement of better tooling that's happening in the Scala ecosystem right now, I think the language will have a fun and productive future! [1]: https://github.com/milessabin/shapeless https://github.com/milessabin/shapeless [2]: https://scalalandio.github.io/chimney/ https://scalalandio.github.io/chimney/
- AheadOfTime295 7y agoMacros and their migration path to Scala 3 have been discussed at the Scala Center, EPFL https://scala.epfl.ch/minutes/2018/12/05/december-5-2018.html https://scala.epfl.ch/minutes/2018/12/05/december-5-2018.htm...
- devit 7y agoThe problem of Scala is that it is outclassed by Rust and Kotlin at its two niches of, respectively, "best designed programming language" and "better Java on the JVM". Scala can't beat Rust because you can't have safe concurrency (and also single-threaded mutation control) without linear types, and you can't have linear types on the JVM; furthermore, a GC and VM-based language is inferior to a native non-GC one providing the same guarantees. Scala can't beat Kotlin because Kotlin is designed to be just a better Java and Scala also tries to do other things that reduce Java compatibility; pivoting would result in being behind Kotlin with no hope of catching up. Furthermore, its core features are cute but fundamentally broken: class inheritance is an anti-pattern and functional features need either purity like Haskell or mutability control like Rust to work safely and efficiently; on top of that, the language is also complicated and hard to learn.
- bmc7505 7y ago> you can't have linear types on the JVM Why can't you have linear types on the JVM?
- MrBuddyCasino 7y agoI don't get it either - its a compiler construct, not a runtime check (remember Rust's "zero overhead" motto).
- deleted 7y ago[deleted]
- pkolaczk 7y agoScala and Rust are not competitors. They solve different problems and are designed for different kind of software. Rust will never be in the same league of productivity / abstraction as Scala is. There is a huge mental overhead of manual memory management that the language forces on you everywhere. Try to write a lockless or immutable Hashmap in Rust and then in Scala to see the difference. Or a graph-like structure. Or async code. Just compare method signatures. Scala is a piece of cake compared to Rust in this area. On the flip side, Scala will never be as good system language as Rust is, even after adding more improvements to the JVM e.g. value types, or even with Scala native. In these use cases where I need a tight control of resources I'd take Rust over Scala every time. As for Kotlin - meh, it is just Java with nicer syntax, not interesting to me at all.
- ccthr 7y agoTo all those saying Scala is dying: Personally I am making top money on Scala gigs, and I don't see that changing anytime soon. The people I meet on these gigs share my opinion. Most people wouldn't take a Java job even if it paid more, same for Go or Node ( both of which I have used in production in the last month, and wouldn't take over Scala, with the exception of serverless) Teams in Media, Government and Finance are leveraging Scala to do things that take Google and Netflix twice as many devs because they use less expressive languages. Yes, Go is great because you can scale a team from 1 to 10 to 100 with little effort. With Scala you get the same stuff done with 20 people. The people that hate Scala are either Java devs that didn't get it because they wanted to write inheritance based OOP code and would still be bad devs in any other lang, or are hiring managers that struggled to get the right people. This is actually an advantage when you have the right hiring process as you end up with better developers - they don't need to know Scala, but need to be open minded to new ideas and motivated to learn. With all that said, the church of FP and the hascalator community is a problem for Scala. Overly dogmatic & academic functional programming styles don't have a place in production systems. Leverage the type system, immutability and the Future/Option monads and you eliminate huge swathes of bugs. If you are looking to write "Java on steroids" or would rather be writing Haskell then you are probably contributing to Scala's perceived problems. If you are a startup or small business then Scala isn't a good fit - you're probably better off starting with JS or Python and moving to Scala when you have more users and need to deliver something solid. FAANG don't need to use Scala because they can throw money & devs at problems and therefore favour languages that fit that modus operandi. For all the companies in between, Scala is great fit because when you get the right people you can outmanoeuvre any competition. One of the earlier comments described Scala as a love child between Java and Ruby that turned out great. Despite not having used Ruby in anger I agree with the sentiment as I believe the best way to write Scala is as a statically typed Ruby for the jvm. It's supposed to be simple and elegant, and the best Scala devs realise this. To re-iterate my earlier statement, if you are trying to write something "oop" or "pure fp" then you are getting it wrong.
- walkingolof 7y ago>If you are a startup then Scala isn't a good fit. FAANG don't need to use Scala because.... Not a FANG, but close, Twitter is a huge Scala shop and was one of the first to run Scala workloads on GraalVM in production. Twitter’s Quest for a Wholly Graal Runtime by Chris Thalinger: https://www.youtube.com/watch?v=PtgKmzgIh4c https://www.youtube.com/watch?v=PtgKmzgIh4c
- 3dprintscanner 7y agoHaving recently jumped into a Scala team from a mainly OOP background, I'm starting to see the light with the language. Using the type system to handle code you would otherwise have to write defensively. Letting the compiler take more of the strain of the second order functional concerns of the program and leaving what's left to be an accurate description of your problem domain is a refreshing perspective on coding. Your code looks a lot more like the problem you are trying to solve rather than 75% if(x==null) and 25% business logic. That said, the learning curve is steep and the quasi-hidden nature of implicits never sits well with me. It seems like a way of adding semi-defined behavior to your code and is one of those language features that should be treated with care.
- wffurr 7y agoCan we talk about this amazing gradual migration plan with code that can coexist at the bytecode level across a major version change? This is a real feat of engineering, and likely to make migration actually happen and be fast and easy. Compared to other 2 to 3 version changes, this is amazing.
- AzzieElbab 7y agoScala is an amazing programming language without rivals when it comes to flexibility. Having said that, while I feel enormous respect for people who pushed functional programming in scala to the limit and almost mainstream, I think blindly porting 99% of Haskell to scala is largely responsible for scalas's observed complexity.
- wbillingsley 7y agoThe complaints I see about Scala mostly seem to centre on whether other people are adopting Scala. "Google's backing Kotlin", "Rust and Go have more trajectory", "FP programmers in Scala write too complicated code that puts off the OO developers", "FP programmers I know are moving to another language", and of course the sad twitter-wars that seem to break out within the Scala programming community that put people off. Personally, I've found Scala to be by far the best language I've ever worked with. The complaints on the complexity of the library are ones they are (at least partially) trying to address in Scala 2.13. Dotty, though not revolutionary, looks like a nice set of improvements too. It's not a "pure FP language" (though some might like it to be), but is a multi-paradigm language on the JVM. It has a lot in it, but moves relatively slowly. To me, those are its advantages, and for someone like me they are fantastic. I am in academia, which means that a lot of my software is written by me for courses and so I get to work on it in patches about twice per year. In Java-land, that'd mean major language versions are now faster than I get to revisit my projects. In Scala, I've had projects progress from 2.10 to 2.13 (and soon 3) with maybe two days' effort updating them so they feel fresh with the language, even though the language still feels more advanced than Java, Kotlin, and most of the "faster" competitors. Scala.js works astonishingly well (I wrote my own react-like framework in about 1,000-lines of code, so I no longer need to fuss about whether React's just updated so everyone should be using function hooks now either). Graal looks like it's going to come along and solve the issues with native deployment soon too. In short, while most of the complaints I hear are about Scala as a community, it seems one of its strengths is how it is robust to the winds and storms that blow through programming communities.