5 ms·
I'm in need of a functional language for a small part of my system and I'm considering Scala and Purescript[0] (mostly because of their ecosystems). Maybe Scala
by haolez 5y ago
I'm in need of a functional language for a small part of my system and I'm considering Scala and Purescript[0] (mostly because of their ecosystems). Maybe Scala 3 is a good time to be boarding Scala's ship.
I'd appreciate if anyone has any advices of one vs the other.
[0]https://www.purescript.org/ https://www.purescript.org/
- flurdy 5y agoI wouldn't jump on the Scala 3 ship just yet. Maybe if mostly a learning project but not for an important part. Whilst it was not a surprise release there will be long time until a majority of the libraries and frameworks will also work with it. The big ones are mostly there, but there are lots of smaller ones that are not and there will be teething problems, even after a long alpha-beta-rc train. Scala 2.13 is still great.
- Scarbutt 5y agoLooks like many libs already support Scala3: https://index.scala-lang.org/search?targetTypes=jvm&scalaVersions=scala3&q=*&page=1 https://index.scala-lang.org/search?targetTypes=jvm&scalaVer...
- virtualwhys 5y agoNot sure what Play Framework is doing at the top of the list, will most likely be many months before a Scala 3 supported version is released. Same for Spark, DB libraries, Akka, etc. Basically everything with large dependency graphs that depend on macros or removed Scala 2 features (e.g. abstract type projections, arghhhh) will take significant time to port over to Scala 3. What has had Scala 3 support from early on in the release cycle are the FP/Typelevel projects, which are obsessively maintained by the I'll-sleep-when-I'm-dead FP crowd.
- ahel 5y agoIs Play Framework still used/developed? Haven't seen any progress from performance in the last years. Happy to get corrected, though.
- flurdy 5y agoIt probably is still the most used framework, probably by quite a margin. Whilst I mostly use Http4s these days I would guess the majority of new projects still pick Play. I would say 60% but would not be surprised if the actual number is 95%. The silent majority just need to chuck out another internal app quickly and Play is great for that. It also looks like it is still heavily developed as 2.9 is released soon. As for performance, shrug.
- kag0 5y agoI agree. But would note that scala 3 is compatible with 2.13 libraries, so long as they don't use scala 2 macros. I think scala 3 is ready to go for production use, but it did come out yesterday. So waiting a tick would be prudent.
- blandflakes 5y agoAre you considering them together, or against one another? I'd have considered Purescript, which compiles to javascript, to compete with Scala.js, but I hadn't realized (but now do) that purescript has a serverside component as well.
- nwsm 5y agoJavaScript has Node and Deno? Not sure the point you're making about serverside.
- blandflakes 5y agoSure, but purescript has to exist as a node package, which it does! I just didn't know that. Last time I'd looked the landing page was way more browser-focused.
- haolez 5y agoOne or the other. It's basically a financial calculator for a niche market, so functional programming fits like a glove.
- dtech 5y agoIf it's a small part of your system take that one that integrates best: JS => Purescript, JVM => Scala, .NET => F# etc. I wouldn't call Scala3 quite "start-a-project-with-it" ready because the ecosystem will need a couple of months at least to update, but Scala 2.13 should suit your needs more than fine.
- yawaramin 5y agoMay I suggest OCaml? It's a pragmatic functional programming language that's often used for finance applications, e.g. derivatives analysis at Bloomberg: https://youtu.be/r6mYb2w_6po https://youtu.be/r6mYb2w_6po . OCaml's strong static type system makes it very easy to write correct code, and its fast compile speed and near-perfect type inference make it very fast to iterate on code. It can also target JavaScript if you need to deploy something on browsers.