2 ms·
As someone who has done a lot of programming in Haskell, I'm glad to see that the limitations of composability across program boundaries is being recognized as
by elihu 10y ago
As someone who has done a lot of programming in Haskell, I'm glad to see that the limitations of composability across program boundaries is being recognized as a problem. (And it may be a problem that Haskell can't fix without some help from the operating system.) When you have to convert data to type "String" in order to send it over a pipe, and then convert it back in the receiving program, that sort of defeats the purpose of having a strong type system in the first place. Similarly, if you have a bunch of processes, each with their own IO Monad interacting with each other, it starts to have an uncomfortable resemblance to the shared mutable state that Haskell tries so hard to avoid.
As for the question of why Haskell isn't more popular, there are a lot of possible reasons. GC overhead and less control over memory layout makes it less performant than C/C++ and not really suitable for real time tasks. Some algorithms are hard to express without mutation. (The ST Monad is usually appropriate for those cases, but it's kind of cumbersome to use.) Laziness makes memory and CPU utilization hard to reason about. The learning curve is very steep. There aren't many books on "advanced" Haskell programming, or writing system software in Haskell.
One of the things I really like about Haskell is that you never stop learning new things, and new abstractions and libraries are being invented all the time. After 25 years or so, we're still figuring out new ways to program in Haskell. This has a couple of unfortunate side effects, though. One is that programmers can become distracted from the task at hand and direct all their effort at figuring out a better abstraction to solve their problem. A lot of great things come out of such work and sometimes it pays off it terms of productivity, but I think the common criticism that there isn't enough practical, "boring" software being written in Haskell is justified. Another problem is that it's hard for Haskell programmers to communicate with each other or understand each other's code when they haven't learned or are comfortable with exactly the same set of abstractions.
I do think Haskell is on to something good. I don't expect Haskell to take over the world, but I think in a hundred years people will look back and say that ideas from Haskell were a major influence on later languages that were more popular. Learning Haskell is probably a good way to prepare for languages of the future that haven't been invented yet, in the same way that learning Smalltalk would have been a good way to prepare for the object-oriented languages that came after.