5 ms·
It’s weird seeing all this post-hoc rationalising when there is a perfect explanation for why go doesn’t have generics: Rob Pike didn’t bother to look into any
by cannabis_sam 8y ago
It’s weird seeing all this post-hoc rationalising when there is a perfect explanation for why go doesn’t have generics:
Rob Pike didn’t bother to look into any of the research into type theory and programming language technology. Hence his understanding of types were restricted to Java and C++ and similar (whose type systems are an abomination), and he could not separate subclass polymorhism with inhertance from parametric polymorhism.
But more important, what it says is that types are the way to lift that burden. Types. Not polymorphic functions or language primitives or helpers of other kinds, but types.
That's the detail that sticks with me.
Programmers who come to Go from C++ and Java miss the idea of programming with types, particularly inheritance and subclassing and all that. Perhaps I'm a philistine about types but I've never found that model particularly expressive.
My late friend Alain Fournier once told me that he considered the lowest form of academic work to be taxonomy. And you know what? Type hierarchies are just that.
https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html https://commandcenter.blogspot.com/2012/06/less-is-exponenti...
I mean he’s openly contemptous of the academics who do research in his field, while wildly mistepresenting their work. But people eat that shit up, because ”OMG it’s Rob Pike” instead of actually discussing the underlying issues.
Yes Rob, you are a philistine when it comes to types.. (or at least were)
- jstimpfle 8y agoOr maybe the academics and type theorists are philistines about the software that runs the world and their arguments have mostly been about hand-picked toy examples? Maybe Mr. Pike actually has some well-deserved reputation when it comes to real-world software and engineering projects that are about handling large scale data in real time?
- apta 8y ago> Maybe Mr. Pike actually has some well-deserved reputation when it comes to real-world software and engineering projects that are about handling large scale data in real time? What are the credentials to back this up? Otherwise, the languages he makes fun of actually are used to deliver large scale systems in real time. Google is built on C++ and Java, so are most of the other top tech companies, not to mention banks and HFT firms.
- jstimpfle 8y agoHe is one of the Unix figures at Bell Labs (although a late-joiner, being younger), he designed UTF-8 with Ken Thompson, and worked on the Plan 9 project, before joining Google. That's probably more than most of us will ever achieve.
- apta 8y agoPlan9 didn't go anywhere. So other than UTF-8, there's not much to speak of. He's not a reference on programming language design, and it shows. Compare to Leslie Lamport for instance, and the tremendous effect he had on large scale systems and software engineering correctness.
- jstimpfle 8y agoCan you argue your case as well as he does? https://www.youtube.com/watch?v=cQ7STILAS0M https://www.youtube.com/watch?v=cQ7STILAS0M Or are you just being disrespectful?
- apta 8y agoI read the slides, but didn't hear the talk. There is so much conjecture in them. C++ is successful, Java is successful, so are Python, C#, and a whole bunch of other languages. When it comes to complexity, large systems tend to be complex, so you either push some of that complexity into your language, to give you expressiveness and modeling capability, or you simplify your language so much (golang) such that the code base becomes complex and verbose due to repetition, not to mention error prone. Readability? Compare: var a int if foo() { a = bar() } else { a = baz() } to final int a = foo() ? bar() : baz() or even val a = if foo() { bar() } else { baz() } the latter two are shorter by a factor of 6, clearer, and less error prone. This is a feature that both improves readability, and reduces complexity. The funny thing is, the golang code bases I worked with would be quite a bit shorter in a supposedly verbose language like Java, not to mention something like Kotlin. Do you want a practical reason why golang is popular? Because it has Google behind its name. The language that he worked on before he was at Google, which were similar to golang, went nowhere.
- bunderbunder 8y agoSo, we would seem to have two key statements being pitted against each other here: 1. Rob Pike doesn't have a strong grasp of type theory. 2. Rob Pike is an accomplished programmer. To me, this conflict of opinions is structurally indistinguishable from 1. That shape over there is a square. 2. That shape over there is blue. IOW, there is no argument to see here.
- overcyn 8y agoNo the two conflicting statements are. 1. Go doesn't have generics because the authors didn't have strong grasp of type theory. 2. Go doesn't have generics, not from a lack of knowledge, but because the authors' real world software engineering experience had shown to them it wasn't important.
- jstimpfle 8y agoWell that was what I was trying to say anyway. Thanks for clarifying!
- bunderbunder 8y agoYeah, the second statement is also valid, though definitely not what I got from the parent's comment. Though, in that case, I think the argument is more like: 1. That shape is equilateral 2. That shape is equiangular It turns out it's a square. Rob Pike's public comments on the subject do seem to betray a weak grasp of actual type theory. Or at least one that is about as strong as it could ever get if your knowledge is primarily informed by practical experience with C++ or Java-style deeply broken type systems. But it's also true that Go's found an alternative approach that gets the job done. Or at least, gets the job done if you're writing the types of programs that he's writing. So, even with the alternative statement, I still see no argument here.
- deleted 8y ago[deleted]
- overcyn 8y ago
- cannabis_sam 8y agoHis well-deserved reputation makes me interested in listening to what he has to say, but you have to evalute anyone’s idea on its own merits. I think there is a tendency to create an unneccessary barrier between ”real-world” software and ”useless” academic theory. I’ve spent most of my career working with java, php, python and js, and I absolutely agree with Rob that class hierarchies and inheritance is a bad way to program, but there’s a lot more to types than oop type systems with limited type inference. It’s of course always a trade off, which is why I build frontends in Elm, backends in Haskell and play with proofs in Agda, but why throw away types altogether?
- ernst_klim 8y ago>about the software that runs the world Software that runs the world utilizes parametric polymorphysm in C++, Java, Ada, D, Swift, OCaml, Haskell etc, hell, even C [1]. I also tend to consider some mission critical Ada/C++ software a real engineering, not some webshit. [1] https://github.com/jiixyj/libebur128/blob/master/ebur128/ebur128.c#L610 https://github.com/jiixyj/libebur128/blob/master/ebur128/ebu...
- jstimpfle 8y agoAnd [1] actually makes a point that we don't need language support for every imaginable use case (maybe not even Generics). It's not a problem to work around a "missing" feature, sometimes.
- AnimalMuppet 8y agoI read what you linked. No, he is not "openly contemptuous of the academics who do research in his field, while wildly mistepresenting their work" (at least not in the linked article). It would be more fair to say that he doesn't think that, in the real world, types will carry enough weight to deserve the emphasis that they are given.