3 ms·
Totally agree. Scala and TypeScript are both usually wonderful to write. Though I might argue that one of Scala's biggest issues in my eyes, performance, is mo
by purkka 4y ago
Totally agree. Scala and TypeScript are both usually wonderful to write.
Though I might argue that one of Scala's biggest issues in my eyes, performance, is mostly _not_ a JVM limitation.
For example, a Scala for-loop calls functions on each iteration, and immutable containers need to be garbage collected for each modification. Both of these could be compiled away in many common cases (like C++ or Rust do, but Scala's compiler doesn't, unless they've changed that in the last couple of years).
- kaba0 4y agoI don't have too deep knowledge of Scala compilers, but Scala 3 is a huge revamp so I wouldn't be surprised to see it change. Though both of the mentioned cases seems to be easy to "fix" by the JIT compiler -- the JVM is really good at inlining and short-lived objects are almost free.
- crabbygrabby 4y agoDid scala 3 finally clean up the syntax. Scala is a difficult language because there are so many ways to do things. I ran away from it after dealing with it professionally off and on for a year. Which is a shame because I did a hobby project with it and it was super fun and liberating compared to old java.
- deleted 4y ago[deleted]
- kaba0 4y ago> Did scala 3 finally clean up the syntax Well, they didn’t break the existing language, so not sure. It depends on what do you find readable/difficult. Because contrary to the usual opinion on the language, I believe it is not “difficult” - it has much fewer exceptional rules than Java for example. Sure, some features are more expressive and that comes with big responsibility, but to actually answer your question, some implicit usage is indeed cleaned up making it much less magical-looking. But scala 3 has been a very huge update, including having a new compile flag that will turn to language “null-safe” (so a nullable String will have String | Null as a type). So it might be worth it to have a new look at the language.
- crabbygrabby 4y agoNull safety sounds great. My big gripe was all of the symbols and how they had different meanings in different contexts. That said, in most cases it's not a real problem, but with a team you can end up with some messy stuff.
- kaba0 4y agoYeah I agree that operator overloading should be used very sparingly, I often dislike it in Haskell as well. Fortunately it seems to be less and less often used in modern libraries.
- pas 4y agoOh I don't think the performance is bad, the JVM is an amazing technological platform, but it uses a lot of RAM, it's GC pauses are bad for latency, and the Scala/Java/JVM ecosystem is simply not that high quality as Rust's. (See all the security issues, log4j2, jdk ecdsa rewrite, just to name the few that come to mind in the last few months.) And for TS I don't think I have to mention the quality of the underlying JS ecosystem :) On the other hand, of course Rust is still on 1.x, GAT is still on the roadmap (though the RFC recently entered into final comment period (or how it's called), yaay!, and then a bunch of legitimate criticism was submitted..., so it might still take year(s))