by Tehnix · 9y ago · 0 comments
I honestly don't find Hickeys arguments to be very valid, and his take on type systems honestly make him sound like he never touched something like Haskell (maybe OCaml) with much more powerful type systems and type inference. He does not sound like someone that invented a language, and more sounds like a blind evangelist for dynamic typing.
> static type systems yield much more heavily coupled systems. And that a big part of that time aspect of the final diagram of what problem we're trying to solve, is dominated by coupling when you're trying to do maintenance, right? Flowing type information is a major source of coupling in programs. Having a de-, you know, pattern matching of a structural representation in a hundred places in your program is coupling, right?
His arguments about coupling seems silly to me, especially since in FP you usually like generalisations and abstractions that allow you to delay specialising to a specific type until quite late. Take all the different typeclasses that exist in Haskell and things like Monads, Applicatives etc that allow such general abstraction.
> Names dominate semantics, a to a, list of a to list of a [talking about `foobar :: [a] -> [a]`], it means nothing, it tells you nothing
It tells so much! It tells us that it takes in a list of any element and the only operations it can perform are something that alters the structure of the list (replicate elements, drop elements etc) and no operations on the elements themselves!
> How many people like UML? How many people have ever used a UML diagramming tool? Right? It's not fun, right? It's like, "no, you can't connect that to that", "oh no, you have to use that kind of arrow", "no, you can't do this", "no, you can't...", it's terrible. OmniGraffle is much better, draw whatever you want. What are you thinking about? Draw that. What's important? Write that down. That's how it should work, right?
I chuckled a bit here, since Hickey just talked about Simon Peyton Jones in the previous slide, I'm assuming he at least Haskell in mind somewhat. If Hickey is seriously comparing Haskell's type system with UML, he needs to go back and take another serious look at Haskell.
> Yes, IntelliSense is much helped by static types and performance optimization, which he didn't list, but I think is one of the biggest benefits. We loved that in C++. And maintenance, I think it's not true. I think that they've created problems that they now use types to solve. Oh, I pattern-matched this thing 500 places and I want to add another thing in the middle. Well thank goodness I have types to find those 500 places. But the fact was that thing I added, nobody should have cared about except the new code that consumed it and if I did that a different way I wouldn't have had to change anything except the producer and the consumer, not everybody else who couldn't possibly know about it, right? It's new.
Honestly this just comes off incredibly stupid and Hickey quite clearly shows he's never programmed in a language with a type system more powerful than C++ or the likes. One of THE BIGGEST advantages of a powerful system is exactly maintenance. He makes the straw man that you have to pattern match every place you lead a type through in your code base, and that you can't "not care" about certain parts of the constructor, but that is just so incorrect. He was half onto the point of, with the compiler telling you all the places you'd have to refactor thought. And that IntelliSense is the only thing he seems to come up with as valid arguments for types...I think that says more about his understanding of types than anything.
I'm gonna leave the rest of the comments up to the discussion I posted in the top, else I would just be rehashing it.
The other response I see is that if he were only aware of feature X (mostly row polymorphism), then that solves his issue. Often feature X is some immature Haskell extension, or exists in research or still niche languages. I don't think switching to Purescript is going to solve more than one of his issues, if even that. And the last thing I've seen is a bunch of folks trying to torture the crap out of Map to prove him wrong (not really) about some offhand point or another.
By and large I've seen a lot of (pedantic) sniping at specific phrasings without much attempt to grapple with the larger points.
The casual dismissiveness of users of dynamic languages (programmers use them because "dynamic types are easy" says one commenter -- about a talk from a guy who has famously thoroughly dissected the notion of "easy.") along with the inability to actually engage with the broader ideas has kinda turned me off the Haskell community.
Lastly, it seemed clear to me from the video and transcript that he was saying performance optimization, not (just) Intellisense, is a clear win for static over dynamic types. And "Intellisense" is kinda just a shorthand for static analysis generally. Again, the point is not that types don't have benefits, its that those benefits come with costs. I think Haskellers often underplay the costs associated w/ dealing with the type system, underestimate how little reach the type system has in an open system where data's flying around arbitrary services, and overstate how much preventing internal inconsistency bugs solves all problems.
I like Haskell, OCaml, F#, etc. I think they make a lot of hard things simpler and help me reason about certain programs better. But they're not panaceas.
I can see why you would feel that, if you hadn't seen Hickey's talk, being having seen it he was honestly quite patronising himself towards static typing, so no wonder he would risk getting some of the same tone back. That said, I don't think it is far off to say he doesn't understand Haskell, either that or he deliberately ignores the solutions that Haskell offer to the problems he's complaining about. Also, one commenter from the thread mentioned,
I do know from interviews that he's done (MS Channel9, i think it was) that he has at least a passing familiarity with Haskell as of 5-10 years ago, but that's a completely different beast to what exists now
Including he himself mainly focusing on having been a C++ programmer.> underestimate how little reach the type system has in an open system where data's flying around arbitrary services
There are certainly times when dynamic programming is nice and all, but I feel your statement is quite disproven with e.g. something like Haxl and Facebooks spam filter, which is an incredibly large scale open system, unless we have some different definition of that.
Finally, I agree Haskell and the like are not panaceas, but when a person goes out with incorrect/invalid points talking down about the effectiveness of a system, when in fact the users of it would agree it is highly effective, I feel like it does no benefit to the community to simply let it stand just because the person speaking is someone kinda famous.
That's not really what's happening. As I explained in my comment, I've found the technical rebuttals by Haskellers to be lacking.
Yes, of course Haskell can be and has been used to make large, high quality systems. I can say the same for C++. That doesn't mean there aren't costs associated with those languages, and good reasons why someone might want to make different decisions about how to design a language. This is literally what the talk was about: why Clojure was designed the way it was. Not why Haskell is a bad language (it's a great language), but why Clojure was designed differently. Pretending like the type system has no costs and only benefits is not serving the Haskell community well.
> I can see why you would feel that, if you hadn't seen Hickey's talk
Not sure what this comment is. I've clearly seen the talk. This pattern of assuming someone who disagrees with you must have less information is off-putting.
What I'm taking away from Haskeller rebuttals is: Haskell has solutions to all your problems, if only you're smarter than Rich Hickey. This is not, to me, a compelling sales pitch.
As one of the Haskell rebutters, let me give my point of view.
Firstly, "Haskell has solutions to all your problems" is a perfectly good overstatement of the case. No need to bring Rich Hickey's intelligence into it.
Secondly, Haskell gets you at least quite far towards Hickey's goals. Haskell does have solutions, or at least partial solutions, to all of the problems Hickey raises. Where the Haskell support is particularly weak, for example with row types, we've admitted that. Yet neither he nor his proponents here have shown any understanding of the Haskell (partial) solutions. If he or they had said "I know about all this great stuff, parametric polymorphism, generics, Dynamic, -fdefertypeerrors, ... but it still doesn't get you close to Clojure because of <specific reasons>" then he would be presenting a useful argument. As it is all we can do is disabuse Clojurists of their basic misunderstandings of how Haskell works.
Am I being hypocritical? After all, I do not know the intricacies of Clojure. But I'm not the one up on stage being filmed making claims about a language I don't seem to be familiar with.
While some languages (Typescript comes to mind) has structural typing, languages like Haskell tend to have nominal typing. So even if your data _looks like_ {'amount': 100, 'currency': 'USD'}, becuase you've wrapped it in a "Money" ADT, now its treated as a different object.
Now sometimes this is valuable! There's a reason we have "newtypes" in a lot of these languages. But other times you end up having to do a lot of wrapping/unwrapping for little reason beyond the type system.
There's a lot of compiler-related reasons for this stuff as well, but if you work a lot in duck-typed languages you can end up getting used to writing stuff that works across data types without any fuss.
I guess my larger problem is that he uses it as an argument static types, whereas it's a solved problem in several existing type systems that has implemented row polymorphism.
[0] https://www.reddit.com/r/haskell/comments/5p307s/row_polymor...
It's been an academic thing for a while, but only fairly recently has it been a thing in even very small languages with use like Elm.
I also feel like a lot of these tools still have some difficulties. There's some conflicts where you can't declare typeclasses on pure Object records in purescript (instead having to go through a wrapper class).
Still agree that forward progress is happening and interesting
> It tells so much! It tells us that it takes in a list of any element and the only operations it can perform are something that alters the structure of the list (replicate elements, drop elements etc) and no operations on the elements themselves!
Yeah this is really instructive about how little Hickey undestands about good type systems.