Live data from Hacker News

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

news.ycombinator.com

1–10 of 128 posts

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

#2
I once used it for mathematical code in my thesis. Basically I had everything written with C++ code but it just didn't work. Also tried Matlab but I'm just not made to use it efficiently, so I tried Haskell for interfacing with the GNU GSL library. In the end I changed back to C++ but it helped me a great deal to understand what I was doing and to clean things up. Some nice features include obviously dealing only with constant expressions and being forced to write only mathematical transformations. A bit unexpected was that you can actually swap variable declarations, declaration order doesn't seem to matter much. Quite a big pain relieve when dealing with a lot of variables.

Actually ImplicitCAD is written in Haskell which implements CSG (very tricky to efficiently implement)

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

#3
Because some people know it, like it, and because they can. It’s like asking why Facebook still uses PHP. But also, every language has something it’s particularly skilled at. There are still business applications out there in COBOL because there are some features hard to replicate in modern ones. No language ever dies.

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

#4
If we focus only on the benefits, her are two basic but distinguishing features that make it a very pleasant and productive language in my experience: - knowing through the type systems that a function’s result depends only on its parameters makes testing more reliable - the syntax and type inference makes it possible to write down many algorithms extremely tersely, which is also helpful in getting the implementation right

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

#5
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,

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

#6
post #4

If we focus only on the benefits, her are two basic but distinguishing features that make it a very pleasant and productive language in my experience: - knowing through the type systems that a function’s result depends only on its parameters makes testing more reliable - the syntax and type inference makes it possible to write down many algorithms extremely tersely, which is also helpful in getting the implementation…

This also provides maintenance benefits. It's not _quite_ that if it compiles (after you make whatever change you wanted to) that it's correct, but it's not far off either.

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

#7
It is very easy to build languages, dsls and compilers in. A lot of language writers at least build a first version or prototype in it. I like it because in my head, all programming is just moving data from one type to another and although this is possible in any language, Haskell and also Idris 2 fit my mental model well. Unfortunately when I have to work with other humans, Haskell never makes the cut, so I only built side projects in it.

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

#9
post #6
post #4

If we focus only on the benefits, her are two basic but distinguishing features that make it a very pleasant and productive language in my experience: - knowing through the type systems that a function’s result depends only on its parameters makes testing more reliable - the syntax and type inference makes it possible to write down many algorithms extremely tersely, which is also helpful in getting the implementation…

This also provides maintenance benefits. It's not _quite_ that if it compiles (after you make whatever change you wanted to) that it's correct, but it's not far off either.

> but it's not far off either.

How "far "off" is it, in terms of correctness, compared to other, more conventional statically typed languages like C++ or Java or Rust?

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

#10

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.

Jane Street has the same rationale.
Post reply on HN