Live data from Hacker News

Haskell is our first choice for building production software systems

foxhound.systems

281–290 of 297 posts

Re: Haskell is our first choice for building production software systems

#281
post #245

Earlier quoted context omitted.

I am not sure where you got the idea that Rust error message suggestions lead to blindly copying 60+ character type specifications. They tend to be much more localized and understandable in my experience.

I got the idea by following the Rust tutorials and then making 'simple' programs, seeing the errors, going to Rust resources and getting the advice 'just cut and paste the expected type'. The expected types generally had 6-8 ':'s, and three to four deep nested type specifiers.

If a significant part of those types was just something like `std::collections::` or similar then I'm not sure I see the problem.

Suggestions should probably trim redundant prefixes like that, but recognizing standard library namespaces shouldn't be a big obstacle to understanding either.

Re: Haskell is our first choice for building production software systems

#282
post #124
post #77

Earlier quoted context omitted.

> There's at least a dozen languages you could have chosen, and that others have chosen for any given use case. within some bounds, it makes very little difference. It's about quality of life and picking the right tool for the job. There are some problems I can solve in Haskell, that I simply could not solve in Java, it would be too hard and too much work. Java is a simple language and therefore it's much easier to r…

Java is much easier to reason about the performance and space usage because it's a language with strict evaluation. Most programming languages use strict evaluation, including OCaml, F# and Scala.

Author here. Having written a lot of Haskell, I don't find lazy evaluation to be an issue nearly as often as it is a benefit. Yes, it can be difficult to reason about at times, but more often it ends up leading to simpler code. I would say that if you're consistently highly concerned with evaluation order, then yes, Haskell might not be the language for you.

But I would also say that you shouldn't be concerned with evaluation order when writing Haskell, in the same way you usually shouldn't be concerned with what the query optimizer is doing when writing SQL.

Re: Haskell is our first choice for building production software systems

#283
post #231

Earlier quoted context omitted.

> why doesn't it just do the cross-function inference It could! This is an explicit design choice. There are a few different reasons. They're all sort of connected... In general, Rust takes the position that the type signature is the contract. If you inferred the types on function signatures, changing the body of your function could change the signature, which means that breaking changes are harder to detect. It also…

> I am gonna handwave this one slightly because I don't fully remember all of the details, but full program inference and subtyping is undecidable. Rust doesn't have subtyping in general for this and other reasons, but lifetimes do have subtyping. I am sure this would get ugly. Correct. Haskell is the only language I know of with globally decidable type inference, and uses the similar hindley-milner method as Rust...…

SML and OCaml also have global inference, and in fact Haskell initially got it from there.

A lot of the "weirder" parts of Haskell are there because early on Haskell was pretty much "LazyML" and then it started growing into something different.

Re: Haskell is our first choice for building production software systems

#284
There is a serious risk using a programming language that is too different from majority of languages. Like Haskell, Erlang, Lisp variants.

It requires a lot of effort to learn, development tools are scarce, and you can't easily hire a new worker simply because it's minor.

Eventually, original developer left the company for one way or other, leaving a code and half baked documents only the early developer fully understand. Good luck maintaining those software. You can't. It's either abandoned or replaced.

Re: Haskell is our first choice for building production software systems

#285

No, sorry, it has very little to do with technology. There's at least a dozen languages you could have chosen, and that others have chosen for any given use case. within some bounds, it makes very little difference.[0] The reason you've chosen Haskell and, by the way, also the TLD ".system", is that you've constructed your identity in such a way that "advanced language with a steep learning curve" is something that f…

> fmap renderPost postList

for(var post: postList) renderPost(post);

Or

postList.stream().map(renderPost)

Re: Haskell is our first choice for building production software systems

#286
post #205

Earlier quoted context omitted.

> "Functional Programming reduces the surface area for Bugs" is a strong claim and can be proven Is there really a formal proof or Software Engineering paper that proves this? I was told this in my FP class in university, but it pretty much sold to me as gospel. In practice I agree with the statement - I certainly feel there's an inherent "cleanliness" to FP. But I also feel that the argument is not only about progra…

> Is there really a formal proof or Software Engineering paper that proves this? I wonder if there is one such formal proof as well. Intuitively it is trivial: functions a are a subset of all procedures, state can introduce unique bugs, these bugs are not found in functions, so you're dealing with a subset of all possible bugs. Another intuition is this: By introducing state you increase complexity. A procedure in is…

> certain algorithms are more intuitive if implemented imperatively.

FWIW, "Dancing Links" is a wonderful technique that would be worse than pointless in an immutable language.

https://arxiv.org/pdf/cs/0011047.pdf

Re: Haskell is our first choice for building production software systems

#287

Earlier quoted context omitted.

This article might be a bit overeager and overzealous, but how you use haskell is up to you -- don't use those underlying packages that disgust you if you don't like them. Haskell offers benefit at every level of abstraction. There are many ways to write Haskell and you do not need a bunch of the higher level stuff. 99% of the time you are just fine with the data modeling (simple Algebraic Data Types) and type classe…

> how you use haskell is up to you -- don't use those underlying packages that disgust you if you don't like them These kinds of arguments are particularly lazy. Of course, Haskell's ecosystem is not so large that it's trivial to find a well-maintained, high-quality version of a library that meets one's other criteria. Programmers of a particular language are at the mercy of that language's ecosystem. This line of re…

I think saying "packages" was an error on my part, because how this is different from the usual C++/other language example is that Haskell is a ML language, and gives you a lot of abstractions (rather than packages per say) to use. Generally using packages in haskell is easy because you don't care what abstraction they were written in (almost always IO is there somewhere, or they offer a doTheThingIO function which is the lowest common denominator), and if they're completely functional libraries then it really really doesn't matter.

The commenter was railing against the abstractions the codebases used, not the underlying packages actually. I don't want to get into explaining it, but it is very easy to write production-ready simple haskell, but also very easy to spend hours building abstractions in the type system (normally) to build yourself a straight jacket. OK so if I explain it a little bit, there are at least three ways that have surfaced in recent time (lets say the last 5 years) on ways to structure large effectful haskell codebases (which is most software you'd want to write).

- Everything in IO (just do everything in the IO monad)

- monad stacks & transformers

- The ReaderT pattern

- Effects (free/freer, polysemy, fused-effects, etc)

All of these approaches have high quality libraries to support their use, but you could stay at that first one (everything in simple IO) and be very happy for a very long time.

I'd argue that C++'s problematic features are of a different nature -- when one of them goes wrong you normally have a much more disastrous outcome (whether at runtime or when you're trying to grok the code). For example compare C++'s templating system to haskell's support of generics for example, one is infinitely safer to approach and easier to understand than the other for the simple case, due to how the languages are built (i.e. no inheritance). Haskell it's more up to you to strangle yourself with the complexity -- the necessary abstractions are pretty simple (typeclasses, monads are simple in use, if not in concept), but the unnecessary abstractions basically scale to PhD.

I will absolutely concede that Haskell does encourage you to reach for higher and higher levels of abstraction for diminishing returns. But I will take Haskell's abstractions over Java's abstractions any day of the week, even though Haskell's can be more inscrutable.

Re: Haskell is our first choice for building production software systems

#288

Earlier quoted context omitted.

> how you use haskell is up to you -- don't use those underlying packages that disgust you if you don't like them These kinds of arguments are particularly lazy. Of course, Haskell's ecosystem is not so large that it's trivial to find a well-maintained, high-quality version of a library that meets one's other criteria. Programmers of a particular language are at the mercy of that language's ecosystem. This line of re…

I think saying "packages" was an error on my part, because how this is different from the usual C++/other language example is that Haskell is a ML language, and gives you a lot of abstractions (rather than packages per say) to use. Generally using packages in haskell is easy because you don't care what abstraction they were written in (almost always IO is there somewhere, or they offer a doTheThingIO function which i…

Well said; thanks for the explanation.

Re: Haskell is our first choice for building production software systems

#289

Good luck scaling this to organization of 100+ engineers. You will soon learn the tradeoff between writing and reading code. And the stark realities of the dev hiring markets and the thing called a learning curve.

That's just untrue and Paul Graham wrote a great essay on that(Python paradox, mentioned in another comment in this tree). I have been working with Elixir for last 5 years, so I guess I can give some first hand opinion.

1. When your company uses esoteric language, your job offers usually have "we can teach you the language" instead of "we require x years experience in language and y, z libraries)". That is a really great filter for people you want to work with, as they have to accept they will be learning from the start.

2. There is a smaller number of engineers qualified, but the number of companies they can apply to is even more reduced. I think all in all you're winning in this equation as a hiring manager.

3. Your hiring process get cheaper, since it moves from having to filter candidates heavily to focus on matching the right person for the team. People who are interested in non-mainstream languages already fit some of the criteria you have to select for otherwise.

4. As the number of people to hire easily is smaller and onboarding even a talented person without experience in tech takes time, you get much better with selecting problems you want to tackle and grow in more reasonable pace. That has great benefits for your organisation.

I know for sure that if I am ever starting my own startup, I will use no mainstream technology. If I want JVM, I will use Clojure instead of Java, if I want web, I will use Elixir instead of Rails/Django, if I go low level, it's Rust, no C++ etc.

It's counterintuitive, but it works better. People think about size of the whole market, but they should think about percentage of candidates applying being fit for the job.

Re: Haskell is our first choice for building production software systems

#290
post #149
post #45

Earlier quoted context omitted.

It would if python actually encouraged runtime coding. In my opinion dynamic programmers need to embrace the runtime environment and use it as part of their development methodology. Unfortunately most popular dynamic languages have woeful runtime environments.

So, Common Lisp and Smalltalk? Any others?

Factor for sure
Post reply on HN