News for hackers. Stuff that matters.
Re:Why isn't Haskell popular in industry? by jrockway on Monday August 02, 2010 @05:16AM (#1567223)
Why is Haskell not a good fit for glue? That's what I use it for, and it works great -- my programs are short, efficient, and easy to write and test.

My first Haskell project for work was initially a C++ project, but it was too hard to use C++ as a glue language, so I switched to Haskell. I would have used Perl, but Haskell works better on Windows and has an easier-to-use FFI.

I actually ended up spending more time trying to get some old version of Visual Studio to link against my super-old-proprietary-C-library that was the core of my project than I did writing the whole Haskell FFI binding to that library and writing the first version of the Haskell-based program.

This turned out to be the most trouble-free program I ever wrote. It had to operate on large datasets, and never died in the middle (like I'm used to with Perl). The only bug that the program ever had was where one of my data validation rules was too strict, and rejected some valid date. (The validation rule said that the dates in the time series had to be increasing. But one series only had one point, and hence wasn't strictly increasing. The bug resulted in "Warning: bad data", though, not "Prelude.(!!): index too large", as the implementation was with fold.)

Incidentally, as a result of this project, c2hs supports Windows DLL calling conventions :)

Re:Why isn't Haskell popular in industry? by gaius on Monday August 02, 2010 @05:28AM (#1567234)
After having written that, I realized it was more nuanced than that. Haskell's good for parsers, for example. I am actually working on one for a proprietary logfile format right now (it will "convert" said logfiles into SQLite .dbs). But if you have preexisting libraries for system A in Java and system B is CORBA then you would be mad to put Haskell in the middle, the impedance mismatch is too great.
Re:Why isn't Haskell popular in industry? by jrockway on Monday August 02, 2010 @06:19AM (#1567304)
This is a software-engineering-in-general problem, though, not a Haskell problem. If you have a bunch of components that can only communicate in a very specific way, then all the components have to communicate in that very specific way. This limits flexibility and "working with the system" becomes the main engineering problem. I think this is why most software dev teams explode to needing 10 teams of managers to manage a million developers -- because so many "irreversible" decisions were made that the application becomes workarounds on top of workarounds. Haskell is not going to magically eliminate bad planning and the fear of refactoring. And similarly, it's not going to make it easy to keep adding shit on top of the shit pile, like Scala or Clojure would. (Not to dis on Scala or Clojure specifically. I've actually never seen anyone do this; they just add more Java 1.4.2 on top of their existing Java 1.4.2-only mess. It would be me that added the Scala or Clojure :)

I actually have a problem like this right now; I'm starting re-development on an application whose components talk via CORBA over an ultra-expensive and ultra-overengineered proprietary message bus. My plan is to write a bridge between the proprietary message bus and JSON-RPC (or something like that) in Scala, and make the rewritten components only talk JSON-RPC. Then, when everything is rewritten, there is no more super-expensive-message-bus requirements, and we shut it off. Now we have the ability to write components in any language.

(Also, the reason this doesn't count as adding shit on top of shit is because eventually the ugly bridge will go away. That only exists to make the rewrite into a refactor. You have to have a scaffolding, or all the shit will collapse on top of you and make a big mess. :)

Now I know the reply is going to be, "well, not everyone can just replace their proprietary crap with something simpler and more generic", but again, that's not a Haskell problem.