Live data from Hacker News

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

news.ycombinator.com

101–110 of 128 posts

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

#101
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…

"JS is almost never the right tool for the job" Except, you know, in the browser...

That doesn’t mean you need to write JavaScript. You can write code in a reasonable language that compiles to JavaScript.

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

#102
Haskell is the Mercedes Benz of modern PL. There are more advanced/esoteric languages, and there are less advanced/esoteric languages, but in general features developed, explored, and tinkered with in Haskell trickle down to other languages.

It offers less and less practical benefits over other languages because other languages evolve to where Haskell has been.

Haskell is correct, and it forces you to be correct and enforces a kind of clarity of thought that is seldom required from other languages. I think it's something you have to discover for yourself. If you don't see Typescript as strictly better than Javascript, you're probably not going to see the benefits of Haskell over any other language.

All that said, we have to ask ourselves which areas of computing Haskell can be profitably used in to gain the kind of critical mass that other languages have:

- Early programming, analysis, data science, etc -> Python is a better fit because it's easier to pick up, easier to understand, even though it's less correct. People discover libraries about checking types at runtime before they discover then can check them at compile time. Python has long since started it's evolution w/ the typing module.

- Web -> JS, because it's basically the only option. Projects like Elm and Purescript have made small dents, but the most successful cultural descendant of Haskell (if you can call it that) is Typescript.

- Startups -> Ruby/Rails, Django, NestJS, etc. win over Haskell here because you don't need to be right to have a successful startup, you need to find customers and after that product-market fit. Your startup could be airflow+google sheets with all-manual validation and still succeed over the most carefully crafted and bullet proof Haskell code.

- Safety critical systems -> Often are required to be realtime and it's easier to get to the safety requirements in other low level languages with strict procedure/process/standards and guaranteed realtime-capable OSes and tooling rather than using Haskell.

I've written about Haskell in the past (excuse the title):

https://vadosware.io/post/how-and-why-haskell-is-better/

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

#103
> Why would anyone choose Haskell to develop applications?

I chose Haskell to develop sumi.news because I enjoy programming in it, and because I don't want to worry about type errors and crashes at runtime.

> Does it offer any actual practical benefits over other languages?

Haskell offers a more expressive type system than other languages.

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

#104
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…

"JS is almost never the right tool for the job" Except, you know, in the browser...

Sometimes yes but for a lot of situations we have better options, like ClojureScript, TypeScript, etc.

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

#105
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…

> JS is almost never the right tool for the job JS is one of the most successful programming languages in history. Millions of JS programmers solve real world problems every single day. It might not be the right tool for you of course but that has nothing to do with JS itself.

The metrics are skewed though because it was all that was available in the browser for a long time.

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

#106
post #31

It's a pure functional language. You can do functional programming in many languages, but Haskell enforces it by design. From what I've seen of the type system, it's quite nice as well. Functional programming allows a great deal of confidence in your code,

Note, however, that you can still write a JavaScript interpreter in Haskell, and then shoot yourself in the foot by having side-effects.

Sure. A program with no side effects can't do anything but warm up the computer

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

#107
post #72

> Does it offer any actual practical benefits over other languages? It sure does. Perhaps you should try it?

Sure, that would be the right approach I guess, but I think the whole point is trying to foresee benefits/problems before wasting time.

I'm of the opinion that trying it out for yourself is not a waste of time. I'm sure several other commenters share that opinion, and I'm sure several others do not.

The tone of the original question reads to me as though the asker is asking to be convinced by evangelists to give the technology a chance. Ultimately though, just listing technical benefits of the language is unlikely to be as effective as one might rationally expect, given that humans — which certainly includes programmers — are less rational than they would like to admit.

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

#108
post #60

Earlier quoted context omitted.

Haskell hides far more of the inner workings than Python, JS or Go. There's a huge gap between the semantics of a non-strict, pure functional language and the actual execution model.

(Username checks out)

Sure, except it should be foldl' instead.

StackOverflow is thataway -->

Edit for reason: https://wiki.haskell.org/Foldr_Foldl_Foldl'

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

#109
post #55
post #45

Earlier quoted context omitted.

> I much prefer the JVM and ASP.NET crew because they are 9-5 programmers, I don't think thats what the parent meant. They meant esoteric functional programming languages vs mainstream OOP ones. You're saying the same thing.

I was clarifying I consider them to be separate categories. Java/.NET cultures are distinctly different to Go/JS/Python despite both categories being mainstream. The former is old, boring and sticks to what works. They are both slow moving, have large established frameworks for each applicable domain, prioritize backwards compatibility, have highly evolved IDEs that support both the language but also the dominant fra…

I feel like you're just describing the JS ecosystem and for some reason included Go in the same group, even though Go's far more similar to Java than to JS.

> [...] move quickly/rapidly adopt new language and runtime features, don't generally care much for backwards compatibility in the library ecosystem, have many competing frameworks and libraries for everything. etc.

None of this applies to Go and in fact, Java is much worse when it comes to churn than Go is. Just look at how many companies are stuck on Java 8. Go updates are fearless - there's no reason not to run the newest version available.

> [...] move quickly/rapidly adopt new language and runtime features,

Go 1.0 was released almost exactly 10 years ago ([1]). Since, there have been *zero* major language changes. The changes that did happen were small, typically to address inconsistencies or small inconveniences. Though, there is one big change coming in this month's release - generics.

[1]: https://go.dev/doc/devel/release#go1

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

#110

Earlier quoted context omitted.

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.

> 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. Which shortcomings of Java/Kotlin are you referring to? What features are both present in all of JavaScript/Go/Python and absent from Java/Kotlin that have any relevance to the Gang of Four patterns?

> What features are both present in all of JavaScript/Go/Python and absent from Java/Kotlin that have any relevance to the Gang of Four patterns?

For example:

1. Being able to define a top-level function

2. Being able to return a function

These either shoehorn every codebase into OOP or force the usage of design patterns.

Mind you, it's possible that if you're writing strictly modern Java/Kotlin/whatnot then these are fixed/irrelevant, but that doesn't erase the billions of overengineered lines of code out there.

From [1]:

> Abstract factory adds another level of abstraction to factory method. While factory method abstracts the way objects are created, abstract factory abstracts how the factories are created. The factories in turn abstracts the way objects are created. You will often hear the abstract factory design pattern referred to as a “factory of factories“.

This type of insanity is exactly what the parent is referring to. Layers of needless abstractions that paper over the lack of basic features every other language has.

[1]: https://springframework.guru/gang-of-four-design-patterns/ab...

Post reply on HN