10 ms·
Why Haskell Is Important
- rocqua 7y agoI think that when mentioning the effect of Haskell on other languages, things beyond rust deserve to be pointed out. Modern C++ has sum-types and 'optional' types. Python has lazy evaluation (generators). Java-script really likes higher order functions (reduce, map, etc).
- yxhuvud 7y ago> Python has lazy evaluation (generators). > Java-script really likes higher order functions (reduce, map, etc). It is a hard sell to claim that either of these were invented or even popularized by Haskell. Just because something has functional roots, doesn't mean Haskell is related to the success of the feature - there are plenty of older languages (LISP!) that have the same features and that likely has way bigger influencing effect.
- jose_zap 7y agoIn fairness, the list comprehension syntax in python was taken directly from Haskell: https://wiki.python.org/moin/PythonVsHaskell https://wiki.python.org/moin/PythonVsHaskell
- anm89 7y agoI don't doubt that Haskell is a great language, but in my experience, if you have to publicly anounce to people at length why a thing is x, it isn't x.
- develop7 7y agoIn my humble experience it can be either. Case in point - the adoption of disinfecting of tools and hands before surgery in 189x-s.
- willtim 7y agoNot true at all. We live in a world were marketing determines the standards used. The current trend is actually to give programmers less guidance on writing correct, composable code ("Dynamic" scripting languages).
- bsaul 7y agoI think that was true 6 or 7 years ago, but we’re heading completely to the other side. Typescript over javascript, rust over c, swift over objective-c, dart adding improved support for static typing, go thinking about generics, etc. I think everybody now go toward compilers or PL enforcing more ( and as soon as possible) rather than give the programmers more dynamic features.
- tempodox 7y agoThat depends on what your definition of “is” is. When something “is” X only if the mainstream understands it without explanation, then you may be right.
- Koshkin 7y agoYes, and it is also important to understand what “is not” is not.
- oddity 7y ago> Haskell’s core principles, like purity and isolation of side-effects, [are] understood and appreciated by more today than ever before If I were to summarize what I think are the most important ideas in the modern functional programming world, I would start with purity and isolation of side-effects (and the mechanisms that have arisen to manage side-effects). However, it seems like most discussion about functional programming centers on type systems and most of what gets imported to other languages is just fancy ways to do iteration. Purity and side-effect isolation, it seems, is seen as a weird curiosity that must be broken in order to write Real Software (TM). It feels like I've slowly watched functional programming get lost in translation the same way object oriented programming was. I'm sure the past decade or two of hype around FP has done some good to real code bases by exposing new ideas to developers who might never have seen them before, but I worry that in another ten years, I'll open up someone's code and find a nested callback hell where state mutations are impossible to track.
- rocqua 7y agoThe nice thing of functional languages is the establishment of invariants. A large part of that lies in purity / isolated side-effects. However, much of it comes from the type system. When ported to 'imperative' languages, those factors from the type system help establish invariant given that people don't use all the footguns. Whilst it is sad there are still footguns that can ruin your invariants, getting better types helps you move away from the footguns. Moreover, it is much harder to export purity to different languages than it is to export good type systems. And really, the good thing that is being taken over is 'make it easier to reason about correctness through invariants'.
- rkachowski 7y agoIt seems like the condensed version is "The idea of Haskell is more important than the language itself", which doesn't really sound like a convincing argument to answer why the language is important.
- willtim 7y agoThere was a hackernews post yesterday where the top voted comment asserted that computer science and maths is (in practice) only useful for data structures and algorithms; everything else needed either physics or social science. This is why Haskell is important. Haskell will help teach people the mathematics behind program construction: how to write composable code, how to reason about effects, how to write consistent, general, less ad-hoc APIs.
- ukj 7y agoThe balance between beauty/structure and effectiveness is tough to get right. There are cases where functional programming is essential, and there are cases where it's an absolute overkill. Developing the judgment to tell which is which is this 'experience' part. 25 years in this industry and I still undergo frequent regret when I write ugly-but-effective code, and frequent anxiety when I have to write 300 lines to accomplish what can be accomplished in half that. Time-preference is a blessing and a curse.
- UncleMeat 7y agoBut it doesn't seem to. Products built in haskell don't seem to have dramatically lower maintenance costs. They don't tend to have features that other products don't have. Nobody buys math. In all of the recruiter spam I get, the only time that recruiters lead with "what language we use" rather than "what we are building" is when the company is using haskell. This seems backwards and gives a poor impression. There might be 100 POPL papers that I can use with haskell extensions but ultimately the act of coding is nowhere near the top of the list of important things when building systems to solve problems.
- willtim 7y ago
- dragonsh 7y agoIn our startup due to earlier experience working with pandoc, we tried to give Haskell a try. It was very difficult for team to pick up and then they took longer to accomplish very little. It did drain out confidence and make us think, we are not so clever. So later moved to Python, and suddenly things changed. In the meantime on personal level at present learning lisp. Once finish will try to work on Haskell again. I think Haskell along with lisp will be good on learning functional programming for my team. It will help them solve logical problems using functional paradigm as well. So in future they can pick up procedural or functional paradigm to solve logical problems better suited to problem at hand.
- willtim 7y agoThere is unfortunately a large learning curve for production Haskell. It's a very different language to most imperative object-oriented ones, that are all broadly very similar. However, the concepts that folks will learn (Monads, Monoids, Functors, Profunctors etc etc) are taken from math and will likely be around for another 100 years. This is not disposable knowledge, and for me at least, it made a refreshing change from learning ad-hoc concepts from each successive OO fad framework I had to deal with.
- alephu5 7y agoI have been learning Haskell from these two books over the last 4 months: "Practical Haskell by Alejandro Serrano" and "Practical Web Development with Haskell" by Ecky Putrady. With other languages I usually just skim through a book figuring out how the basic data structures, flow control and operations then start writing a toy CLI app or server but with haskell I felt completely lost when trying to follow examples in library documentation, even after several weeks of reading books. So I found it's really worth carefully going through the programming book and doing the exercises, at least beyond the monad transformers section, before diving into real code. I'm over the hump and am writing & understanding working code now, but still a long way from the level of mastery I have with imperative programming.
- ratww 7y ago
- gabrielblack 7y agoI'm mainly a C/C++ programmer, I use also python, I'm learning Go and I'm reading about Rust. But I think my programming skill are a little "stereotyped", so I'm looking for something different, you know, to open my mind. So I read the article, here on HN, about all the "exotic" languages, Lisp for example and others. I was reading this article about Haskell and I think it's too abstract to stimulate a novice to go further. Some details about the advantages cited and related examples should be present to give motivation to the newcomers. On the contrary, the part about the evolution gave the impression of an immature language. My two cents.
- molteanu 7y agoQuestion is, why would you want to consider the more "exotic" languages? What would the motivation be, for you, in trying out new languages? The hint that these might not be for you, yet, is right there in your question. You consider yourself a C/C++ programmer. I think most of the folks who grok these Lisp and Haskell languages just consider themselves programmers plain and simple, or engineers, or curious little heads, or artists, or something similar.
- gabrielblack 7y agoI would consider other programming languages different from c/c++ because I don't want my capability to solve problems bonded to specific tools, this is the motivation I learnt other languages. Evolution maybe, the animal becoming too specialized, in case of environmental changes, will face the extinction. I'm looking for tools better able to solve specific problems. You can stick screws with an hammer, maybe it's faster but a screwdriver tool exists to better solve the problem and its evolution the electric screwdriver is the state-of-the art and probably the best choice. Now, having to deal with a limited resource, time, I have to choice what to learn seriously and this article doesn't help me to do a choice. Those choices also could influence my professional capabilities in the futures, because, you know, I do the programmer to live. > just consider themselves programmers plain and simple Plain and simple programmer is bullshit, IMHO. What do you write in your CV, "professional programmer plain and simple" :-) ? Oh, please, save your rhetoric.
- amelius 7y agoUnbalanced post because it doesn't address evidence against Haskell. For example: - Performance is lower than most systems programming languages. - Performance is also more difficult to reason about. - If Haskell is aimed at building large and complex systems, then where is the evidence, e.g. an operating system? (A compiler is just a pipeline so doesn't count; it is of a different kind of complexity) - The GHC compiler internals are badly documented (despite some great books about its global architecture). Why do people who pursue clean software engineering methods not follow good software engineering practices?
- jose_zap 7y agoI’m a bit conflicted about your point here, because they seem cherry-picked to highlight disparate aspects of Haskell that don’t make it less interesting or important. Haskell is more often than not sued as a general purpose language, not as a systems language. Its performance is actually outstanding, usually equal to Java and often close to C. This means that Haskell can be safely used in any domain were java would be fast enough. I find also somewhat arrogant to claim that there are no complex systems built in it. Just take a look at the webpage publishing this article. They mention several projects of great complexity. Here’s an example: https://www.tweag.io/posts/2017-03-13-linear-types.html https://www.tweag.io/posts/2017-03-13-linear-types.html They are using Haskell as a prototyping language that lets the refactor and radically change the direction of their solutions at a low development cost. Haskell clearly is helping solve complexity here. Also, where did the claim that GHC is badly documented come from, and how is it relevant to Haskell being important? Just looking at randomly selected file in the repo, it looks actually quite well documented: https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/simplCore/FloatOut.hs https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/simp...
- amelius 7y ago> they seem cherry-picked to highlight disparate aspects of Haskell I only said that the article was unbalanced and provided some counter examples. I didn't say that Haskell does not have many good uses.
- mrkeen 7y ago
- philzook 7y agoI think many of these comments are asking too much of a single short article. Or they want the article to be addressing the questions that they have rather than the question it was written to address. The author is stating very high level reasons about why Haskell is a fairly unique language, as a (relatively) practical, popular, and pragmatic vehicle of programming language progress (mind your ps). For those that want concrete reasons for why it would be useful for a beginner, my personal honest opinion is that it may not necessarily be. Haskell does seem to require a decent amount of investment before it becomes practical. You may derive benefit from seeing the functional style in an enforced context. I know it informed and changed my python style a quite bit. You may find that these patterns were all around you the entire time and you didn't notice it, like learning new vocabulary words. Anecdotally, my interest in Haskell seems to have been very good for my career so far and I have not had difficulty finding jobs that coincide with my interest in typed functional programming generally. Perhaps I have been very lucky.
- dmitriid 7y agoThe most important thing about Haskell is this: serving as a test bed for programming language theory and ideas. Some of these ideas eventually find their way to other programming languages. Other ideas remain just ideas and academic experiments.
- pythonwutang 7y ago“Why Haskell is important” according to a Haskell consulting company. So taking this article with a big grain of salt. Haskell might be a great language but barely anyone (besides CS academics) uses it. We use java and python in production because (among many other things) they’re very popular. Popular languages have large archives of open source packages and easy to find communities that save enormous amounts of headaches and time. The opposite is true of Haskell, at least for now.
- danielscrubs 7y agoAll valid points. It could in the future be done in a better way is not really interesting when you are working with your boss breathing down your neck. Still my fellow academics will try to push in the direction they see fit.
- jbergens 7y agoI am still not clear on why Python has become popular. It wasn't a few years ago. They might use it more in universities nowadays but it seems backwards if the business's starts using languages just because they are used in education. By the way, I don't here much about companies using Python in Scandinavia except for some AI.
- deleted 7y ago[deleted]
- Koshkin 7y agoI’d love to see a Haskell in Lisp’s clothing. (The Haskell that exists has so little syntax that source code often looks like a mass of unstructured text.)
- privethedge 7y agoThere was Liskell, but it seems it's dead. https://wiki.haskell.org/Haskell_Lisp https://wiki.haskell.org/Haskell_Lisp
- platz 7y agohttps://github.com/lexi-lambda/hackett https://github.com/lexi-lambda/hackett Under active development, still WIP
- chongli 7y agoHaskell, being a curried [1] language, seems fundamentally incompatible with Lisp, which has variable arity [2]. [1] https://en.wikipedia.org/wiki/Currying https://en.wikipedia.org/wiki/Currying [2] https://stackoverflow.com/questions/11218905/is-it-possible-to-implement-auto-currying-to-the-lisp-family-languages#11219134 https://stackoverflow.com/questions/11218905/is-it-possible-...
- uryga 7y agothere's [Hackett](https://github.com/lexi-lambda/hackett https://github.com/lexi-lambda/hackett) though it's more an implementation of haskell within racket
- linfocito 7y agoThose very same arguments could be rather used to say why Racket is important.