Live data from Hacker News

Why isn't Haskell popular in industry?

palgorithm.co.uk

31–40 of 145 posts

Re: Why isn't Haskell popular in industry?

#31

I think there are a couple reason. Haskell is a significant departure from most other languages commonly used by industrial programmers. It's a relatively shallow learning curve from Java to Python to JavaScript, but making the leap to a pure functional language is very difficult. Path-dependence plays a huge part here. This isn't just a matter of "people being afraid of what's different" as the article suggests; the…

Another, more important reason, is that Haskell is too intellectually demanding for most industrial programmers. t

While that's often stated as a reason, I don't believe it myself, simply on the grounds that anyone smart enough to use C++ "in anger" is smart enough to learn any language.

The reason that Haskell isn't popular (IMHO) is that a lot of programming isn't clever algorithms, it's forms (interfaces for getting data into databases) and reports (interfaces for getting data out of databases). A lot more is glue (connecting the output of one program to another). Haskell just isn't a good fit here.

I am very excited by F#; here we have an ML dialect that has minimal impedance mismatch with the OO/imperative world (and C# with LINQ has minimal impedance mismatch with the declarative world of relational databases). This is where Haskell types should look for work...

Re: Why isn't Haskell popular in industry?

#32
post #9

Failing to work on Windows is a much bigger problem than I think most people realize. You can write Java on Windows and (mostly) have it run on Linux or Solaris with no problem. And Windows has a 95%+ share in the corporate OS market. Ruby on Rails has a similar problem (though it's got better on Windows recently), and so does Django, which is a nightmare to get working in a Windows environment.

Haskell works fine on Windows. Some of the lead GHC devs use Windows machines. GHC even comes with a Win32 binding that lets you do GUI programming (doesn't come with a GUI kit for any other platform standard.)

Re: Why isn't Haskell popular in industry?

#33
post #22
post #8

Earlier quoted context omitted.

This reddit post tells me why Haskell isn't that popular. http://www.reddit.com/r/haskell/comments/cs54i/how_would_you... Writing a quick directory traversal function should be a no-brainer in any reasonably general-purpose language. The fact that the above reddit thread is jam-packed with the ins-and-outs of doing this simple task in Haskell tells me that Haskell may be great for some things, but it's probably not g…

What most other languages do, though, is exactly equivalent to Haskell's unsafePerformIO. If you want to interact with your environment in possibly-destructive ways (and sending a message out of the runtime, whether to the network or the OS, always has the possibility of being destructive, because you can never guarantee what a system not under your control will do in response to your message), just accept the remind…

Except that it's not necessary, because at least 3 solutions that don't use unsafePerformIO were posted to that Reddit thread.

Re: Why isn't Haskell popular in industry?

#34
post #8

Every language has a catalyst that pushes it from obscurity into mainstream use. Whether it be a project (Ruby on Rails), a programmer (Linus Torvalds -> C), a company (Google -> Python), or a library (Boost -> C++), there is always a force behind adoption. Most languages undergo a "fad period", where it's hip and cool to write in it and people just do it because other people do it. Clojure is going through this righ…

This reddit post tells me why Haskell isn't that popular. http://www.reddit.com/r/haskell/comments/cs54i/how_would_you... Writing a quick directory traversal function should be a no-brainer in any reasonably general-purpose language. The fact that the above reddit thread is jam-packed with the ins-and-outs of doing this simple task in Haskell tells me that Haskell may be great for some things, but it's probably not g…

To illustrate this point, a choice snippet from that Reddit thread, explaining part of what seems to be considered 'the proper solution'. Please note that my intention is not to make fun of this, but to illustrate that the terminology in which people in the Haskell community communicate makes it impenetrable for someone just trying to pick up the language and do stuff with it.

  it's a straightforward lifting of the non-monadic version. You can almost get
  it from g_hylo by using the identity comonad, it's distributivity law, the
  identity natural transformation, and using T.sequence as the monad's
  distributivity law[1]. But this doesn't quite get us there because it requires 
  that we can refactor the monadic parts of the coalgebra into the algebra.
http://www.reddit.com/r/haskell/comments/cs54i/how_would_you...

Re: Why isn't Haskell popular in industry?

#35

I think there are a couple reason. Haskell is a significant departure from most other languages commonly used by industrial programmers. It's a relatively shallow learning curve from Java to Python to JavaScript, but making the leap to a pure functional language is very difficult. Path-dependence plays a huge part here. This isn't just a matter of "people being afraid of what's different" as the article suggests; the…

achieving anything practical using purely functional code remains extremely difficult ...

Excel is pretty much a functional language (though it is a little disabled), and people do amazing things in it.

The problem isn't that functional languages are hard. They are a bit different, but good code is often fairly functional anyway. The problem is that most of the community seems to be obsessed with showing that functional languages are both better, and more difficult, than mere procedural languages.

Take monads. The only way to "get" monads is to realize that they are just sections of the program that are imperative. But most Haskell programmers introduce them in the most incredibly obscure double-talk, just to avoid admitting that Haskell needs the ability to do imperative things in order to be useful.

Re: Why isn't Haskell popular in industry?

#36
post #31

I think there are a couple reason. Haskell is a significant departure from most other languages commonly used by industrial programmers. It's a relatively shallow learning curve from Java to Python to JavaScript, but making the leap to a pure functional language is very difficult. Path-dependence plays a huge part here. This isn't just a matter of "people being afraid of what's different" as the article suggests; the…

Another, more important reason, is that Haskell is too intellectually demanding for most industrial programmers. t While that's often stated as a reason, I don't believe it myself, simply on the grounds that anyone smart enough to use C++ "in anger" is smart enough to learn any language. The reason that Haskell isn't popular (IMHO) is that a lot of programming isn't clever algorithms, it's forms (interfaces for getti…

I would argue that most people who use C++ in anger don't fully understand that language, and get by because they do what they know has worked before. The accumulated experience doesn't imply intelligence.

That's not to say that I think that it's intelligence that's lacking with respect to Haskell etc. I think the problem there is the mode and style of thinking, and that most programmers are too old to easily pick up the different way of approaching problems that it becomes second nature. That, and functional programming's chosen compositional breakdown of fixed common data with an open-ended set of applicable functions is not always as applicable as object orientation's breakdown of open-ended data with inheritance of fixed sets of functions; you often need to introduce an extra level of indirection (=> abstraction) with functional programming to get access to the dynamism that OO gives you in the box.

Re: Why isn't Haskell popular in industry?

#37
post #22

Earlier quoted context omitted.

What most other languages do, though, is exactly equivalent to Haskell's unsafePerformIO. If you want to interact with your environment in possibly-destructive ways (and sending a message out of the runtime, whether to the network or the OS, always has the possibility of being destructive, because you can never guarantee what a system not under your control will do in response to your message), just accept the remind…

Except that it's not necessary, because at least 3 solutions that don't use unsafePerformIO were posted to that Reddit thread.

But "not necessary" has never been the problem here. People are complaining because the idiomatic way to explore a directory structure in Haskell isn't familiar to them—it's functional and mathy and strange (because exploring a directory structure in a pure-functional way is mathy and strange.) They want the language to be "as easy to use" as, say, Python, for directory-diving—but that basically means that they want to do it the same way they'd do it in Python. The only part that's hard is figuring out how to do it "the Haskell way"—a.k.a., the unfamiliar, math-filled way.

What people need to learn is that you don't have to do that for everything. You can have all the advantages Haskell brings while not trying to make everything in sight into arrows and co-monoids; if it's easier to do it the non-idiomatic way (i.e. the way that doesn't involve turning your easily-expressible business domain into difficult-to-express Mathematics), then do that part that way, and get back to work.

Re: Why isn't Haskell popular in industry?

#39

Earlier quoted context omitted.

Why doesn't Haskell support objects? Seems like that would be quite useful. They don't need to be mutable or anything. They could be like records, that scale.

Because it has typeclasses, which solve the same problems without creating the new problems that conventional objects do. Why doesn't Java support pattern matching?

Typeclasses don't solve the same problems as objects do. Typeclasses are a way of getting access to more operations in polymorphic code, which in functional languages is a compile time feature; they're also a way to implement overloading.

Objects are a way of implementing protocols without needing to know the details of the object that implements the protocol, even at runtime. Polymorphic code in OO systems is a runtime feature, not a compile time one; objects may be loaded dynamically and almost always are at some level in any large OO system, for configurability and testing if nothing else.

Re: Why isn't Haskell popular in industry?

#40
I think the main issues are that lazy evaluation makes it more difficult to reason about the performance of your code, both in terms of what actually gets computed in which thread / on which core, and in terms of space requirements (lazy evaluation can force the runtime to keep things referenced longer than you might expect offhand). I'm not saying a good Haskell programmer can't overcome these obstacles, just that this is definitely a perceived barrier to commercial Haskell development.

Check out this paper for a discussion of these issues in a real world Haskell application:

http://www.starling-software.com/misc/icfp-2009-cjs.pdf

Post reply on HN