cecograph
kiwifarms.net
- Joined
- Oct 17, 2018
I think it's cool if a language caters to both. I want industry folk to be able to get stuff done without running into some massive roadblock that your abstractions put in the way. And I want library designers working outside of deadlines being able to explore new ideas in a language that, once battle tested, can be used by those same industry folk. Every company I've worked for has been the beneficiary of libraries that try to push the envelope on what a language can do.Don't mistake those that spend 24/7 playing with libs or masturbating on message boards about monads, to those who work and actually have deadlines to meet.
As for academics, Scala was created by one. He had previously created Java generics with the help of Phil Wadler, one of the creators of Haskell. He worked to introduce higher-kinded types into Scala, and Haskell was used as a reference for this. He also worked to introduce typeclasses. The first line of the abstract of that paper is:
"Type classes were originally developed in Haskell as a disciplined alternative to ad-hoc polymorphism."
Guess what? Once you've got higher-kinded types and typeclasses, you've got the primary abstraction mechanisms of Haskell. That's why Haskell people show up in HN comment threads going "where are your higher-kinds?" It's because once they have them, they know they can use your language to write Haskell.
Scala doesn't steer away Haskell programmers. It explicitly tried to appeal to them, and they showed up.
And if you want to complain about masturbatory over-abstraction, let's just remember that Scala's standard library is absolutely full of it. Here's what the type signature for the map function on lists used to be:
Code:
map[B, That](f: A => B)(implicit bf: CanBuildFrom[List[A], B, That]): That
And this isn't close to the worst of it
Scala's problem isn't that Haskell people infected it. They were invited, and a precedent had already been set for a lot of type abstraction. Scala's problem is that it tries to shove a whole bunch of very powerful but non-orthogonal concepts into a language, and the end result is that there are usually far too many ways to solve a problem, most of them are bad, and any abstraction inevitably leaks or is horribly non-ergonomic.
Now F# has a similar story to Scala, in that the guy behind it was also an academic with a background in typed functional programming and was responsible for generics on the CLR, but F# is infinitely more opinionated than Scala, has simple abstractions, working type-inference, gives priority to functional programming, and has mostly kept the Haskell people away. For another example, Kotlin does a decent job of marrying FP and OOP, by not trying to be anywhere near as advanced as traditional typed FP languages. Its abstractions are simple, and they mostly keep the Haskell people away. If you want a simple amicable relationship between typed FP and Simula style OOP, I recommend Kotlin if you're on the JVM, and F# on the CLR.
Last edited: