4 ms·
> How about having to create six different files Took me a few reads but it's better stated "six different classes". At first I was confused about why you rel
by libria 7y ago
> How about having to create six different files
Took me a few reads but it's better stated "six different classes". At first I was confused about why you rely on `java.io.File` for business logic.
So, if I'm stuck on JVM, what's my FP alternative that compiles and runs comparatively? Clojure? Scala?
- bsder 7y agoClojure. If I'm stuck in JVM-land, Clojure followed by straight, modern Java would be my choices.
- pkolaczk 7y agoScala. Particularly Scala 3. Because it is principled but also very pragmatic.
- hota_mazi 7y agoScala failed because it's the opposite of pragmatic. If you're looking for pragmatic, take a look at Kotlin. As for Scala 3, it's still years away, if it ever comes out. And when it does, there's little reason to think its goals will be different from what Scala 2 was (an academic language) since it's the same team as Scala 2 writing it.
- jhomedall 7y agoIn what way is Scala not pragmatic?
- hota_mazi 7y agoIt's a language that's aimed more at research, producing papers for conferences, and financing the EPFL and its PhD students than at users in the real world. There's absolutely nothing wrong with that, by the way, I love studying all the advanced concepts that Scala has pioneered over the years. But it's also the reason why it's largely in decline and why Kotlin has taken the industrial world by storm: because it is a pragmatic language.
- jhomedall 7y agoI've used Scala in production environments, and we never had any problems with it being too academic. SBT sucks, but that's another issue. Kotlin doesn't have typeclasses (something you get as a side effect of Scala implicits), ADTs, or true pattern matching (along with exhaustivity checks). In combination, all of those allow for expressive, easy-to-read code that, in my experience, tends to have few bugs. Kotlin is a step backwards from that. It's still a significant step up from Java, however. F# is the only other language I've used that I've found comes close. However it lacks typeclasses, and the large Java ecosystem.
- hota_mazi 7y agoA step backward to you is a step forward in pragmatism for the rest of the world. I understand the value of higher kinds and I'm comfortable with Haskell, but it's pretty obvious to me why Kotlin is succeeding where Scala failed. Sometimes, improvements in programming languages are reached by having fewer features, but Scala is a kitchen sink that was always unable to turn down features, just because their implementation would lead to more research papers to submit to conferences. As a result, we ended up with a monster language that contains every single feature even invented under the sun.
- pkolaczk 7y agoAFAIK Scala is much more popular than Kotlin in terms of job postings and projects in big enterprises. My data limited to some Fortune 100 companies tell me it is on par with Python in popularity. Spark, Kafka, Flink, Finangle are written mostly in Scala. Pretty impressive for an academic, non-pragmatic language that has failed, isn't it? So can you elaborate what do you mean by "failed"? Because it seems you are using a different definition of it. "Sometimes, improvements in programming languages are reached by having fewer features, but Scala is a kitchen sink that was always unable to turn down features, just because their implementation would lead to more research papers to submit to conferences." That's some different language you're talking about. Scala is built on a small set of very powerful, general, orthogonal features which cooperate nicely and allow to build most of the stuff as libraries. Its design is much more principled than Kotlin's. Kotlin has special features built into the language, that Scala needs just a library for.
- LandR 7y agoYes, clojure