Live data from Hacker News

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

news.ycombinator.com

111–120 of 128 posts

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

#111
post #39

Earlier quoted context omitted.

> If you are prototyping extremely quickly then maybe Ruby on Rails might be the right tool for the job (and thus attract the right kind of people). I am puzzled by this because my early experience of Ruby On Rails (and I mean early -- 2005) is that every Rails developer I encountered knew much less than they were letting on. > Go attracts mediocrity and not in a good way, it also actively repels the "right " people…

For context I worked with Go extensively for about 5 years. I tried very hard to like it because I have immense respect for folks on the core team. I even wrote some pretty good code in it. However a few things became very clear to me over time. 1. Go is -not- a general purpose language. It lacks expressiveness necessary for this purpose which leads to overly hard to follow and refactor business logic, repetitive and…

> Poor/inconsistent null handling

That's one of my gripes with the language too. Due to the lack of generics, Go programmers just use pointers to indicate nullability - not exactly the right approach. Thankfully, it's still an improvement over Java, as non-nullable pass-by-value semantics are the default, so if you want a pointer you have to explicitly define one.

I have my fingers crossed that once generics land, the ecosystem switches over to some sort of an Option type.

> have a poor module system

I'm curious, what's poor about it?

> runtime with almost no knobs to apply workload specific optimisations, etc

The approach Go takes is that the GC should "just work" for all workloads. Obviously, this will never be 100% optimal for any given workload, but you know... tradeoffs.

That said, the knobs you're looking for do exist, but they are in the language itself. Unlike Java, Go makes writing GC-friendly code easy.

> Even in Java [...] you have all the primitives at your fingertips, real threads, powerful reflection, metaprogramming and runtime introspection.

Aren't "real threads" strictly worse than green threads?

> powerful reflection, metaprogramming

Those are misfeatures, especially metaprogramming.

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

#112

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.

In the Hitchhiker's Guide to the Galaxy, this is called "The B Ark".

https://hitchhikers.fandom.com/wiki/Golgafrinchan_Ark_Fleet_...

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

#113

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…

Dang. I'm pretty deep into Rust (working on a very large production codebase) and was hoping it was real. The book even says, in the section on Async, that Async is a cult and you should avoid it. My people!

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

#114
post #15

Earlier quoted context omitted.

Maybe the same applies to building a RESTful API and choosing Go instead of js :)

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…

Honest question:

If Spring basically "fixed" java development...

Why hasn't it been ported to Go? Wouldn't it fix the same problems there?

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

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

Honest question: If Spring basically "fixed" java development... Why hasn't it been ported to Go? Wouldn't it fix the same problems there?

Spring relies heavily on the more powerful features of the Java runtime which aren't available in Go, it wouldn't be possible to port it as-is. You could definitely come up with a set of existing Go libraries that implement all the core functionality of a Spring up in a cohesive way. Almost every large company I have been at has done exactly that however none has caught on in the same way Spring has.

Spring hasn't "fixed" Java development however but rather provided a consistent framework that has stood the test of time. It still has flaws but it's been around for long enough that nearly every conceivable issue you could run into already has a well known solution. The end result is you spend very little time fixing Java or Spring problems.

In Go land however there isn't much in the way of consistent and/or well integrated ecosystems. You end up stitching everything together yourself and as a result can run into all sorts of combinatorial set of dependencies that can present effectively un-Google-able problems. Thus you spend a lot more time working out how to integrate your HTTP server, router, middlewares, tracing, logging, etc all of which are pre-solved problems with are large framework like Spring.

It wouldn't be possible to "fix" the same problems in Go unless either a new framework was developed from scratch that really took off or one of the collections of libraries was able to achieve dominance.

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

#116

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.

Actually from a business perspective PHP or something would be the best choice? Lots of (relatively speaking) cheap devs available at all levels. Wasn't Java designed around the idea of medicore developers not being able to mess up too badly?

Functional languages do appear to attract smart people, but I see far more people with an interest in the language than actual jobs out there. They seem more geared towards compute science (more theoretical) over software engineering (solving real world problems).

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

#117
post #18
post #16

Earlier quoted context omitted.

This can cut both ways. Yes, if you choose Haskell, a Lisp, or something like Erlang, you can get smarter/better devs. But the flip side of that is that the types of people who tend to gravitate toward those languages are often more interested in programming for it's own sake and not the domain they're working in. So you get things like people burning hours writing their own libraries and endless tinkering with progr…

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…

Things like Django or Requests are old stable projects in python.

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

#118
post #38

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.

Can you give an example of what kind of boilerplate you mean? Because I feel like modern Java and Kotlin have improved a lot in this area.

How do you open a file and print "hello world" these days? It was at least a screen full of code the last time I looked at Java, but that was a while ago.

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

#119

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…

> monads are the Aristotle philosophy equivalent of programming. Take care not to study them too closely. Monads is just a pattern for composing functions that can’t be composed using “normal” function composition (because of incompatible types). That’s all it is. I never understood the fetishisation/worship of monads in the Haskell community.

That's a nice way to put it. I guess the fetishisation comes from the fact that being able to do arbitrary function compositions coincides with a fundamental mathematical structure, even if the impact on code productivity is questionable.

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

#120
post #115

Earlier quoted context omitted.

Honest question: If Spring basically "fixed" java development... Why hasn't it been ported to Go? Wouldn't it fix the same problems there?

Spring relies heavily on the more powerful features of the Java runtime which aren't available in Go, it wouldn't be possible to port it as-is. You could definitely come up with a set of existing Go libraries that implement all the core functionality of a Spring up in a cohesive way. Almost every large company I have been at has done exactly that however none has caught on in the same way Spring has. Spring hasn't "f…

What runtime does Spring utilize that Go doesn't have from ... say .. the XML conf files era of Spring? I understand annotations and classpath scanning are entirely different animals.

I guess AOP magic doesn't exist either.

Json/Yaml versions of the xml era should be possible. I guess no xml namespace magic (which I hated)...but a consistent object graph specification would seem useful.

Post reply on HN