| ▲ | btreecat 2 days ago |
| I'm still trying to reason what the value proposition of Scala is in a business sense. Developer are more expensive and harder to find, the tooling is weaker, the ecosystem less deep, performance suspect, and the overall XP feels clunky. Plus our hardware is procedural, and contains/manages state within the instruction pipeline. I strongly believe it doesn't belong as a core business technology. |
|
| ▲ | noelwelsh 2 days ago | parent | next [-] |
| I don't think this comment reflects reality. A few issues: * Complaints about tooling and ecosystem were valid maybe 10 years ago, but not now. * You don't say what your point of comparison is. (weaker than what?) * Performance has never been an issue for general programming tasks * You disregard the value that language brings * Running functional programs on a CPU has not been an issue since, roughly, the 1970s when the basics of compiling FP languages were worked out. |
| |
| ▲ | btreecat 2 days ago | parent [-] | | None of that answered the question of what's the value proposition is, while also missing the point of several criticism. | | |
| ▲ | noelwelsh 2 days ago | parent [-] | | The Scala value prop is a modern programming language (= safer, more correct code, which implies faster development) + access to the JVM and JS ecosystems (and WASM and Native in more nascent states.) Given your comment about stateful CPUs I imagine you don't think programming languages are particularly important. Not everyone does, but opinions do differ on that. > also missing the point of several criticism I can't correct my misunderstandings if you don't state what they are. |
|
|
|
| ▲ | lanthissa 2 days ago | parent | prev | next [-] |
| So the starting point is you want the JVM/Java interop, if you don't want the JVM find something else. From there you have Java, Scala, and Kotlin as primary choices. Up until 2020 java didn't have pattern matching or records, and kotlin still doesn't have a full implementation. Scala offers an ecosystem where its very easy to build a robust type system, supporting clear co and contravariance and clear control flow due to pattern matching. On top of that scala's compiler plugin ecosystem is quite good and it allows large organizations to abstract away a lot of busy work to dedicated internal teams. This is used extensively in large scala codebases I have seen. Scala is a fantastic language for core business technology, in fact thats probably the single thing its best at. Its why the largest code bases I know of are in financial institutions. DX/tooling is a valid point, but the large scala codebases that exist within orgs have their own tooling that solves this, at least old twitter and the financial institutions do. So to answer your question, why would someone choose scala in a business sense. Any JVM project built between like 2009-2019 had a compelling reason to choose scala over the other options and maintains those advantages though other languages have implemented most of the key features so the gap is much smaller. |
|
| ▲ | 62951413 2 days ago | parent | prev | next [-] |
| You're unfortunately right. Every Scala codebase I have seen recently is essentially legacy. New services are not built with it anymore. Other than blaming SBT and the Haskel fans I'm not aware of a technical justification. But the industry/community has shifted since 2015-2018. The only rare exceptions I heard of were strict FP shops who share nothing with common JVM-based development. You could have a few years of full-time Scala experience with Akka and Spark and they won't even screen you. In the year of our Lord 2024 the question is if you want to bet on Java21+ catching up with Kotlin or go with Kotlin from day one. The choice is less obvious nowadays. I'd go with a modern language, actual job market sides with Java still. At least on the backend in the Bay Area. As a side note, I cannot imagine a competent JVM-based developer not familiar with either Kotlin or Scala by now. In a typical Java shop half of the team is dying to switch to one of them in my experience. |
|
| ▲ | hocuspocus 2 days ago | parent | prev | next [-] |
| The small pool of experienced developers is actually awesome. I waste a lot less time screening candidates and they're usually above average. Moreover, despite what people claim I've had no issues mentoring juniors or people coming from other paradigms but willing to learn. Tooling isn't as good as plain Java but good enough, and certainly better than that of more niche FP languages. The ecosystem is pretty rich in spaces where Scala really shines, in some cases it's even better than libraries and frameworks you can find in Java or Kotlin. Plus you can always consume any Java library. Performance is good enough for Twitter or big data workloads at major tech companies (many of them use Spark). And nowadays with GraalVM native images you can even reduce the memory footprint to very reasonable levels, not very far from Go. |
| |
| ▲ | btreecat 2 days ago | parent [-] | | You have a lot fewer candidates to pull from too, which is often a more limiting factor for a business. Business don't need everyone to be a rockstar who's also a FP whiz. But FP languages need that. | | |
| ▲ | hocuspocus 2 days ago | parent | next [-] | | I've been leading hiring efforts for my team for a while now and Scala has never been the bottleneck. Especially now that the Scala market has shrunk a bit. It's true you need some level of expertise and seniority, but that doesn't mean you need to hire only FP wizards, far from it.
I believe most modern hybrid languages can be dangerous without supervision. | |
| ▲ | GregarianChild 2 days ago | parent | prev [-] | | For what it's worth, Scala is a multi-paradigm language and can be used as a pure OO language. This is a great way to start for programmers with an OO background | | |
| ▲ | hocuspocus 2 days ago | parent [-] | | I'm not sure it's a good idea though. Scala failed (mainly to Kotlin) as a "better Java". If you aren't committed to Scala's unique features, I would avoid it. It doesn't mean you need to go all in though, Scala can be simple, simpler than Java in fact. |
|
|
|
|
| ▲ | halfmatthalfcat 2 days ago | parent | prev | next [-] |
| In the right hands, the terseness and expansive nature of the language (big stdlib, java interop, implicits/givens, higher-kinded types, immutability first, etc) can greatly increase productivity, however it takes a higher caliber of developer to wield it effectively. Not to mention also the rich ecosystem in the functional side of the house with ZIO/Typelevel, or distributed frameworks like Akka. Poor Scala devs output complete junk, however high performers produce incredibly elegant and concise code. |
|
| ▲ | fifilura 2 days ago | parent | prev | next [-] |
| Apache Flink has deprecated support for Scala. https://cwiki.apache.org/confluence/display/FLINK/FLIP-265+D... An aggregation engine like that was otherwise a good fit for a functional-ish language like Scala. That said - it is a nice language. Native support for simple functional language constructs (map / flatmap, Option, Try), without having to go all-in on functional style. |
|
| ▲ | wbl 2 days ago | parent | prev | next [-] |
| Hardware is actually functional. It will do whatever is needed to get the results you actually want while secretly rearranging everything. And I mean everything: loads and stores don't execute in anything resembling the order you wrote them in. State? An illusion that doesn't even exist the majority of the execution time and has to be expensively reconstructed when things go wrong. Circuits are deeply functional: everything is computed all the time and only selected from. |
|
| ▲ | ndriscoll 2 days ago | parent | prev | next [-] |
| Performance is in the same space as java or go, but it's a much higher level language, so easier to write, easier to read, and easier to review. The language prevents many classes of errors without cluttering the written logic, so it's easier to understand what it's doing in terms of business domain. The jvm ecosystem is also massive. If developers are more expensive, presumably there's a reason they're able to ask those rates besides "they know scala". |
| |
| ▲ | btreecat 2 days ago | parent [-] | | > Performance is in the same space as java or go, but it's a much higher level language, so easier to write, easier to read, and easier to review. What metrics are you using to make the claim that it's "easier" than more widely known, better tooled, and easier to search languages? >The language prevents many classes of errors without cluttering the written logic, so it's easier to understand what it's doing in terms of business domain. I've not seen this play out on a codebase of nontrivial size. I find it forces new ways of doing the same old stuff because "functional" > If developers are more expensive, presumably there's a reason they're able to ask those rates besides "they know scala". Why would you presume that it's not a simple supply and demand? The fact is there a fewer FP devs. Why is that if FP is "better"? There's fewer Scala devs, because Scala isn't better. | | |
| ▲ | valenterry 2 days ago | parent | next [-] | | There are no studies for anything, and if there were, they would be outdated by the time they are published. So if you ask such a question, do you really expect anything more than people's firsthand experiences? But I'll tell you my own side as well: doing anything with concurrency in any other language (yes, including Go and Rust) is just much much harder in comparison to Scala. No wait, that's not true. There are languages that are better suited for that. But they are either academic or extremely niche and come with other problems (such as lack of ecosystem or much worse performance). > The fact is there a fewer FP devs. Why is that if FP is "better"? The fact is also that the number of FP devs has been and is growing. And so has the number of languages with those features. > There's fewer Scala devs, because Scala isn't better. What metrics are you using to make the claim that it "isn't better"? | | |
| ▲ | btreecat 6 hours ago | parent [-] | | Fewer devs, fewer libs, fewer tools, fewer projects. Those are all quantified with out a research study. |
| |
| ▲ | GregarianChild 2 days ago | parent | prev | next [-] | | > if FP is "better" The term FP has lost precise meaning over time, and split into several related meanings. • Focus on the absence of side-effects. (E.g. Agda, but not Scala, Ocaml, F#) • Focus on the higher-order functions. (This is no longer controversial, but used to be) • Focus on rich types. (The ML (the programming language) tradition, note that Lisp and even Lambda-calculus were born untyped) • Focus on the use of traditional functional idioms, e.g. map-reduce, even when the implementation is totally not functional. Which one are you referring to? | |
| ▲ | ndriscoll 2 days ago | parent | prev [-] | | My claim is backed by years of direct experience with C, C++, Java, Go, Scala, PHP, and Python. I can tell you that Scala has been the easiest to write, read, and review by far. I'm not sure why you'd expect "easier to read and review" to be metrizable. Nor do I see the connection between those things and wide use, tooling, or searchability. If you need to search something to understand what you're reading, I suppose that itself is a measure of that code being difficult to understand (i.e. it does not stand on its own). > I've not seen this play out on a codebase of nontrivial size. I have :shrug:. There's currently this discussion[0] about some functional design principles on the front page. Things like making illegal states unrepresentable mean that you just don't have to think at all about various would-be error paths (again, making it easier to write, easier to read, and easier to review), and while Scala doesn't automatically give you such a design, it at least makes it possible (unlike e.g. Go). You just need a good lead to guide people's design. In fact "make illegal states unrepresentable" is perhaps just one facet of a more general observation that if you accurately model your domain, the code basically writes itself. IME Scala's type system hits a sweet spot of giving you the ability to model what you need without forcing you to model concerns you don't want to care about (e.g. Rust's lifetimes). Demand for what? Why would there be intrinsic demand for Scala programmers? Why isn't there a similar premium for Perl or COBOL programmers? It's not like Javascript or C/C++/Rust where you have limited options of what languages can be used in some domain (browsers, embedded, etc.). It's a high level application language, which is a space with tons of other languages. One possible contribution is that it has features that more experienced engineers can appreciate (like a compiler that helps prevent basic errors and a good concurrency story and workable macros so that you can focus on teaching your team domain context instead of looking for errors with nil references or locks or whatever or poring over tons of boilerplate. Performance is also good enough that you probably don't need to worry about e.g. horizontal scaling), so you may tend to see them wanting to use it more. e.g. I did a few years of PHP (Laravel) work. You won't ever find me taking a PHP job again; I've had enough of it for one lifetime and don't need that kind of stress. My understanding is Ruby/Rails are similar, so again I just wouldn't consider a Rails job. I'd probably prefer working with Scala, C++, or maybe Rust, so you're more likely to find me in a "Scala programmer" statistic and won't find me in a "PHP programmer" statistic, but that's not really why I cost more. I expect more money than your average developer because I have more experience than your average developer and I've been in tech lead roles for a while now. [0] https://news.ycombinator.com/item?id=42244851 | | |
| ▲ | btreecat 6 hours ago | parent [-] | | Having also used all those languages, Scala was easily the worst documented, tooled, and community supported. That makes it worse as a language overall because of the reduced devex. You may personally find it great, but as a business language, it isn't. |
|
|
|
|
| ▲ | dionian 2 days ago | parent | prev [-] |
| It's a more powerful version of Java. Java is still trying to backport features from Scala. |