7 ms·
> Postgrest is a great example of a real-world Haskell codebase. It's hard to read. Very messy. https://github.com/begriffs/postgrest/tree/master/src/PostgRES
by gothrowaway 10y ago
> Postgrest is a great example of a real-world Haskell codebase.
It's hard to read. Very messy.
https://github.com/begriffs/postgrest/tree/master/src/PostgREST https://github.com/begriffs/postgrest/tree/master/src/PostgR...
Despite 15 years of programming experience in python, js, C, etc. I feel like I'm going to have to duck my head down to be chastised for not understanding the language and not being "intelligent" enough to see the depth.
It looks like jibberish, to me. Not trying to be offensive. I'm sure the person who written it had it make sense to them. You likely also notice, a lack of code documentation. Bad form. Don't tell me it's because I don't know haskell, that's why I'm not expending the time to learn it, despite the buzz.
Meanwhile, SQLAlachemy and Hibernate isn't reporting complaints and a human being could actually parse it to understand what the hecks going on there. And despite it being Python or Java - easier and far more widely adopted languages - they're documented extensively, the authors didn't solipsistically assume others would "get it".
Which is a pattern I've been seeing with hardcore functional advocates in communities. They are the kind of people who'd work 2 weeks on a paper for a mathematical proof, shove it to you in the hallway to look smart, and say "It's obvious". It's not, you're just trying to show you're smart, but no one's understanding you - and that is important in you winning people over and not looking arrogant.
> It's concise for the amount of functionality it offers
Make it 4 times as many lines. Because there is so much condensed inside of this.
>8k stars. Less than 50 contributors. Of which, only the top 7 changes more than 100 lines.
If this considered a real world haskell, it's no wonder there's not a lot of people using it.
It does more to demonstrate functional programmers lack empathy for enterprise ones. Because even with solid grasp of CS concepts, even Haskell's own proponents are having a hard time stomaching contributing to it.
- dtech 10y ago> It's hard to read. [...] Despite 15 years of programming experience in python, js, C, etc. I feel like I'm going to have to duck my head down to e chastised for not understanding the language. [...] Don't tell me it's because I don't know haskell, that's why I'm not expending the time to learn it, despite the buzz. To me you're a classic example of the "Blub Paradox" [1]: languages with other features/language constructs than you're used to just seem worthless, complex, without value and foreign to you. You mention a lot of experience in hardcore imperative/imperative-OOP languages (C, JS, Python). Haskell, Rust, Scala etc. require a bit of a different mindset and thus have an initial steep learning curve. Compare it to lamda's. Did you see the value in anonymous functions the very first time you were introduced to the concept? Now that you've probably used them for a while, would you be happy to use a programming language without them? You're not willing to learn the language because you don't understand it, and dismiss the language as having no value because you don't understand it. Is that really fair without at least having a basic understanding of the language? [1] http://wiki.c2.com/?BlubParadox http://wiki.c2.com/?BlubParadox / http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html . I'm not a fan of the "I Know LISP So I'm Better Than You" tone of the original article, but I do fully agree with the key point that it's hard to evaluate language constructs you're not used to.
- gothrowaway 10y ago> languages with other features/language constructs than you're used to just seem worthless, complex, without value and foreign to you. Document the Haskell code and not stuff so much logic into one line. I think that's a fair thing to ask for in software engineering. Anyone who complains about Haskell seems to have either a.) not programmed it b.) weren't programming "correctly" c.) a xenophobe/blub/NOS I know what lambdas are, I know there are functions and folds. That in and of itself doesn't tell the story of the data that's actually being manipulated and the expected output. So that's why you have a 20-30 line comment block explaining what's going on in important API functions. You could program python, JS or ruby similarly; wrapping multiple functions on the same line until you have to actually trial each function to figure out why your not getting an expected result. It feels clever, at the moment, but we don't do it because we're not helping colleagues understand it. > You're not willing to learn the language because you don't understand it, and dismiss the language as having no value because you don't understand it. Is that really fair without at least having a basic understanding of the language? The commenter was heralding the project as a "great example" of "real-world haskell" and recommended contributing to it. I was shocked to see 8k stars and a paltry 50 contributors; of which, only the top 10 have contributed over 100 lines of code. That's half the contributors, proportionally, to something like neovim or redis, and even worse compared to node.js projects. And, I looked at the code of the project, which is open source, and didn't see code documentation. I'm trying to be generous. My advice: stop packing the code so close and document it, probably more than normal, since the symbology in their is highly dense.
- ruslan_talpa 10y agoHere is a project with about the same number of stars/contributors/contributors with more then 100 lines/time since release https://github.com/graphql/graphql-js/graphs/contributors?from=2015-06-28&to=2017-03-25&type=a https://github.com/graphql/graphql-js/graphs/contributors?fr... :) So by your logic, i could say: "If this considered a real world javascript/node, it's no wonder there's not a lot of people using it." which is obviously wrong. You are using the wrong metrics to judge the language popularity. Virtually every OSS project has only a handful of core contributors. PS1: Note that i am not arguing PostgREST is a great example of real world haskell, it's not for me to say since i have bias :) PS2: You are right that the source code is not commented and it could use a little of that but what you are missing (because you are not used to haskell) is that a lot of the documentation for haskell projects comes from the types and type signature of the functions. So just by looking at that, in a lot of cases, a haskell programmer can reliably tell what the function is doing without any documentation
- eklavya 10y agoWhy is it not ok to be complicated/complex if it's worth it? People do not complain about the complexity of a car compared to a cart, it's just doing much much more. It's ok to want a cart for whatever reason but I don't understand why then you have to say that a car is bad? A lot of people are happy writing Haskell. In fact they seem to like it so much that they would kill for a Haskell job!
- rimliu 10y agoHow much more does Haskell do compared to other languages? Does it posses some unique properties which puts it high above other languages? Back to cart and car comparison: despite several levels of magnitude difference in complexity the difference in complexity to operate is not that great. That is, you are not directly exposed to the underlying complexity. Meanwhile programming languages should be optimised for reading first.
- sjayasinghe 10y agoIt's more about familiarity with the abstractions provided by the language. Sure, the complexity difference in operating a cart vs a car is not that big. But if someone has never seen a car or familiarized themselves with how to operate one then the perceived complexity is going to be enormous.
- scriptkiddy 10y agoArguably, A person who is familiar with the operation of a cart would be at least somewhat familiar with the operation of a car in that they both roll in a specific direction based on user input. That said, the complexity of operation in a car arises from increasing the number of controls from 1 to, at minimum, 10. I would say the cart to car analogy is more akin to learning a complex API. I would say that a better analogy for traditional languages vs. Haskell is that of a car to a fighter jet. The fighter jet is faster and really really good at certain things like movement on 2 planes and firing missiles. However, the fighter jet is orders of magnitude more difficult to operate and requires much more maintenance. For real world concerns such as getting groceries or transporting furniture, a car is the much more practical choice. I mean, we'd all love to own a fighter jet, but would any of us really have a use for it other than screwing around?
- a-saleh 10y agoOn one hand I would want to argue with you ... because for me this [1] is arguably more readable, than i.e. java code-base. But I haven't done anything in Java for ~5 years. And I have worked through a haskell text-book recently :-) On the other hand, I heard somebody say "Haskell program file usually consists of 10 language extensions, 20 imports, and 1 line of Perl" and I understand the sentiment :-) [1] https://github.com/begriffs/postgrest/blob/0b486ccf446c6480dc59c60c41af1fc002c2a6a7/src/PostgREST/App.hs#L67 https://github.com/begriffs/postgrest/blob/0b486ccf446c6480d...