Live data from Hacker News

Ask HN: Why would anyone choose Haskell to develop applications?

news.ycombinator.com

81–90 of 128 posts

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#81
It's an expressive, pure, statically typed functional programming language with a large enough package registry, community and optimized enough runtime/compiler.

Breaking down the benefits of each:

- Expressive: you can model things with greater fidelity

- Pure: you know when your code performs side effects, so you're in for fewer surprises

- Statically typed: you learn about things at compile time, not in production. You also need to write fewer tests.

- Large pkg registry: fewer things to implement yourself (compared to, say, Idris)

- Large community: fewer problems you'll be the first one to discover/solve

- Optimized enough compiler: compile times can be _acceptable_

- Optimized enough runtime: your app will be fast enough without you having to care much about it

Now one point that isn't obvious from all this and that is a big selling point for my company is how much of a breeze refactoring is. Types give you more guarantees around how your code behaves, so there's classes of mistakes you can't make, and won't have to rely on a super strict test suite to prevent you from making.

Newhire submitting a PR changing 25 files all over the codebase? Business as usual.

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#82

You’re in luck. I prepared an entire thread on this subject, as someone who was forced to learn it by necessity rather than by choice. https://twitter.com/theshawwn/status/1490237220950876161?s=2... I’ll come out and say it though: Haskell is a cult. It’s best to smile and nod when you’re around the believers. They’re harmless. Ditto for rust. It is truly astonishing how much code a determined team of haskellers can…

Wow. A whole 15 thousand lines of code, you say? Golly, that is just astonishing.

What does the lines of code have to do with Haskell? Specifically, why did you feel this was important information? What you wrote is almost a non sequitur. That Haskell programmers are efficient and the fact that your port of a Haskell code base to python has reached 15KLOC are two completely orthogonal pieces of information.

You probably didn't have to do it without running the program.

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#83

Something Haskell programmers commonly experience is that their programs typically work the first time they compile, due to the type system. I was skeptical of this but I've experienced it myself too -- it's kind of fun! What this means is that you spent most of your time thinking about how to express your code elegantly in the type system, but once you do it usually just works. That's a huge practical benefit you do…

That aligns with my limited experience, that Haskell programmers seem to spend most of their time thinking about how to do something in Haskell.

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#84
post #18

Earlier quoted context omitted.

This is where I differ. I think the Python/JS/Go crew gets you stuff that is built poorly and becomes expensive to maintain. I much prefer the JVM and ASP.NET crew because they are 9-5 programmers, their tools aren't constantly changing so for the most part they only need to spend time actually doing work. No fighting with package managers, no updating the latest framework and solving backwards incompatibilities for…

I prefer Javascript/Go/Python because most of my code is actually doing something instead of just conforming to a Gang Of Four pattern designed to paper over the shortcomings of my tool. I too want my programmers to be thinking about and solving my business problems, not writing boilerplate.

Do you prefer your English communication from people with limited English language proficiency, because they have things to say without attention to grammar, precision, and logical structuring?

Lack of understanding of nuance works about as well in programming languages as it does in English - it's very limited and causes issues, which often the low vocab user is simply not aware of. But the issues exist nonetheless.

Essentially you are arguing for a low level of education in the craft of programming, and this is why many (experienced/career professional) people tend often select against users coming from those languages.

Another poster just down agrees with you, but notice they mention they started with Python, which is a beginner language with limited detail, and can't grok why they need to learn more to use Java and why it's worth it. I agree, they can't understand why, but that doesn't mean there aren't valid reasons. It just means they have more to learn, and 'don't know what they don't know' (yet, hopefully).

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#85

Earlier quoted context omitted.

"Code to interfaces instead of implementations" type boilerplate Code that doesn't do anything except support a design pattern you're following is boilerplate.

This sounds like less a problem with Java or Kotlin and more a problem with the development team. If you're dealing with a bunch of new developers who just barely read the GoF book and think it's a prescriptive guide to all things code, you're going to end up with a lot of boilerplate. But if you turn a bunch of new developers loose in any language without supervision, they're going to build something bad. There's no…

The issue here is the experience level of the devs. These sorts of conversations should have people declare their years of programming experience at a minimum, it helps to understand perspectives better.

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#86

When I asked my current employer why they chose it, they simply responded that it attracts the "right" people. From a business perspective, any language is arbitrary. What matters is having clever people around to solve problems.

Eh. The "right" people can have perverse incentives.

My former mentor worked at a startup called Takt that billed itself as Haskell-only. It attracted all the top minds - Runar Bjarnason, who wrote a famous Scala book, worked there - and everyone was very eager to write Haskell code for a living.

The engineering team quickly went all-in on functional everything. Nix for package managers, a Haskell-to-JS transpiler for writing frontend code, immutable databases, the works. Because they eschewed all the boring technology that had been proven reliable over the years and only played with the bleeding edge in Haskell, they quickly ran into limitations of the ecosystem: performance degradations as they hit corner cases, missing functionality that needed to be patched upstream, corner cases that no tooling had existed to support it, etc. Before long, they were single-handedly supporting the broader Haskell ecosystem rather than spending cycles delivering on the business contracts they had.

This was all very fine with engineering - why not contribute upstream? Why not drive Haskell to broader adoption, which was in line with the company's values? - but management balked. They began to raise the possibility of maybe ditching their bespoke tooling and moving to something more standard. This didn't go down well - it caused a schism, where half the engineering team felt the right way forward was to double-down on the existing nascent Haskell technology and offer more support and training, and the others who just wanted to get stuff done.

Anyway, the startup failed. Turns out, when you hire for people who really believe in a programming language, you can occasionally attract zealots.

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#87
post #23

For your good old boring business software - ADTs and patter matching combo is, IMO, the most visible, practical benefit over "traditional" languages used in the industry. And something I miss the most when not writing in Haskell.

Pattern matching has been added to various parts of C# these days.

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#88
post #42
post #15

Earlier quoted context omitted.

You will get slightly better people but still the wrong people. JS is almost never the right tool for the job, Go is occasionally the right tool for the job, mainly if you need to write something that moves bytes from one fd to another without much in the way of business logic. TBH if you are building something boring you should just use Spring w/Java or Kotlin. This will attract pragmatists that ship code that works…

>Go attracts mediocrity and not in a good way, it also actively repels the "right " people if you want to hire for highest intellectual horsepower for a given budget. This is painting with a pretty broad brush. I like Haskell (and first learned it before it was cool, in the early 2000s), but I also enjoy coding in Go. Not everyone is strongly driven by choice of programming language in their job search. If you do hir…

What exactly did Dijkstra say about Cobol Programmers?

In 1975, Edsgar Dijkstra famously proclaimed that “The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence[sic].” This undoubtedly led to the decline of teaching COBOL in universities, but it remained the dominant business language.

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#89
post #82

You’re in luck. I prepared an entire thread on this subject, as someone who was forced to learn it by necessity rather than by choice. https://twitter.com/theshawwn/status/1490237220950876161?s=2... I’ll come out and say it though: Haskell is a cult. It’s best to smile and nod when you’re around the believers. They’re harmless. Ditto for rust. It is truly astonishing how much code a determined team of haskellers can…

Wow. A whole 15 thousand lines of code, you say? Golly, that is just astonishing. What does the lines of code have to do with Haskell? Specifically, why did you feel this was important information? What you wrote is almost a non sequitur. That Haskell programmers are efficient and the fact that your port of a Haskell code base to python has reached 15KLOC are two completely orthogonal pieces of information. You proba…

[ smiles and nods ]

Re: Ask HN: Why would anyone choose Haskell to develop applications?

#90
post #77

Earlier quoted context omitted.

Python came out in like the early 90s I think when the Berlin wall hadn't been knocked down for all that long. It is OLD and battle tested by many many high profile companies. Granted, sometimes it isn't the right tool and the JVM is. Same is true in reverse as Java has significantly more boiler plate than Python. I do agree Python has changed more over time.

It's about rate of change, not age. Also about design of the ecosystem in general. In JVM land almost all code is implemented in managed code. This means the likelihood of severe (runtime degrading) bugs is greatly reduced. It also means in practice you can just step into any arbitrary library code using an interactive debugger to fully follow the flow of execution. Contrast that to Python where every library worth u…

How much of a problem is that for users? I figure less than 10% need to do what you're referring to.
Post reply on HN