4 ms·
As somebody who works with Scala, List comprehensions (and associated filters) were indeed a surprise to me as well when I started hacking in Haskell. Their res
by suj1th 9y ago
As somebody who works with Scala, List comprehensions (and associated filters) were indeed a surprise to me as well when I started hacking in Haskell. Their resemblance to logic programming makes it so much more elegant, and so much easier to reason about.
- s4vi0r 9y agoHow do you feel about Scala currently? I'm a Scala dev as well who's kind of been moving away from it over the past few months. I'm not really sure of the future of the language. Most of the super committed community members are fans of the Haskell inspired style, which is great (its how I write Scala, personally) but I'm not sure why you'd then choose Scala over Haskell, or if you need the JVM, Eta or even Frege. The majority of 'casual' Scala people seem to use it as Kotlin with implicits more or less, and as more and more libraries and features come up for Kotlin I'm not even sure that it makes sense to use Scala for those people, given the larger backing, better tooling, easier on boarding, etc for Kotlin.
- kod 9y agoThere are plenty of people who use scala as an ML on the JVM, not as a worse Haskell. They just aren't as loud about it. If you're looking for an ML kind of experience, Kotlin is a joke, it doesn't even have pattern matching.
- suj1th 9y ago>If you're looking for an ML kind of experience, Kotlin is a joke, it doesn't even have pattern matching. Can't agree with this more. I just cannot figure the raison d'être of Kotlin.
- s4vi0r 9y agoTo me it seems sorta like reasonable Java. Tons of QoL upgrades that Java hasn't (or won't, due to compatibility issues) implemented over the years make it so that you can write Kotlin without absolutely having to rely on a massive IDE or something like project Lombok. They've got great tooling and a lot of support, and they've been adding in tons of great features (e.g inline classes/value classes coming soon). If I had to build a company today Kotlin would definitely be at the top of my list; I may love other languages much more, but Kotlin and C# are easily at the top of the developer experience imo, since they've got great tooling/ecosystem/support and both are very approachable/average languages that won't really scare anyone away like how Haskell might (despite it being one of the most underrated/most scare monegered/most misunderstood languages out there imo)
- s4vi0r 9y agoWould you care to explain more about your style? It sounds like a nice compromise, and the lack of pattern matching and HKTs in kotlin is definitely a bit of a pain point after having gotten so used to Scala and Haskell. ML on the JVM seems like a nice niche for it, but I'm not sure I really have seen libraries or Scala devs sorta advertise their style/library as ML inspired. I've seen OCaml mentioned as an inspiration to Scala before, but there are some notable differences between the two (e.g. inheritance vs structural typing)
- kod 9y agoI don't agree with everything suggested here, but this is similar to what I'm talking about http://www.lihaoyi.com/post/StrategicScalaStylePrincipleofLeastPower.html http://www.lihaoyi.com/post/StrategicScalaStylePrincipleofLe... especially the reasoning that you should try to avoid mutability, but when something is mutable, just make it mutable. This is much more in line with ML approach than with typical Haskell concerns around effects systems.
- suj1th 9y agoPersonally, I started out in Scala as a 'casual' user using it as better Java/Kotlin. But, I have certainly seen myself gradually gravitate towards Haskell-inspired style. For many like me (with more exposure to OOP than FP in early career), it is a pedagogical device into FP. With regards to the future of Scala, particularly tooling, Scala may still be able to retain its 'casual' users with its recent focus on tooling : http://scala-lang.org/blog/2018/02/14/tooling.html http://scala-lang.org/blog/2018/02/14/tooling.html
- simon_o 9y agoScala has always been big on advertising it's abilities to abstract over things with it's type system (higher-kinded types, constructs from category theory, Haskell-inspired typeclasses), but has failed to actually out those capabilities to good use. Just one example: Everybody pretends that e. g. the map function in collections is totally unrelated to the one in Futures, or the one in Slick, or the one in Quill, or the one in Spark. We all know that this is not just a random coincidence in naming.