[Haskell-beginners] Motivation to Learn Haskell

Greg greglists at me.com
Mon Sep 6 00:16:27 EDT 2010

I think the financial industry is attracted to Haskell because it's lazy.  (ba-dum dum!)

I'm in a similar spot as you are, and I'm making a second or third attempt to get a handle on Haskell (depending on how you count).  I'm doing it for much the same reasons you are, and for similar applications.

In my case, most of the simulation work is done in Matlab, and partially in C.  C is undisciplined and error prone, which makes it slow to develop simulations in, and which is why people tend towards Matlab.  Matlab is much slower, and has the unfortunate tendency to treat everything in the world as though it were linear algebra-- but it's relatively rapid for development.

I've dropped my pursuit of Haskell a couple times after a few days each time for the reasons you're alluding to (and because the type system hurts my head), but I'm back at it again because it feels like there's something of value in it.  

In part, it feels more elegant-- in the same way that Scheme felt elegant (hey, don't judge me...).  In particular, lazy-functional seems like a really good match for simulation work: it feels right to represent the world as f(t) and to feed it time as an infinite list rather that write a loop that basically says "while the world hasn't ended, do:".  It also holds the promise of straight-forward parallelization which is critical for anything requiring performance on a modern platform.  

I haven't worked with R, so I can't comment on it, but for me Haskell is different enough from the other languages I work with that it forces me to (which I hope later means "allows me to") look at problems differently.  I think that's what you mean by a mind expanding exercise, and it's  a benefit I found in learning C++ after C, but not a benefit I found in learning Python after C++ because they're just too similar in concept.

There is quite a wealth of libraries available through the hackage system, but I'm choosing to treat the lack of established libraries in some areas as an opportunity-- I find writing algorithms I'm familiar with is a great way to get comfortable.  Once I know more of what I'm doing, I'll probably start pulling in more established packages just for their better optimized implementations and for compatibility reasons.


On Sep 3, 2010, at 3:57 PM, Lorenzo Isella wrote:

> Dear All,
> It is my first post to this list and please do not take it as an attempt to start any flamewar.
> From time to time, I try to find the motivation to learn at least the fundamentals of another programming language.
> I normally use R and Python on a daily basis (but I am not that much into OO programming) and have a good knowledge of Fortran and a rather superficial one of C.
> Beside learning a new language as a sort of mind expanding exercise, I try to figure out how and if it can save me some time in my work and how it measures up against other languages.
> These days I tend to rely on R for data analysis and visualization whereas I use Python (in particular Numpy+SciPy) for number crunching (it is very convenient to use scipy/numpy to solve ODE's, manipulate arrays and so on).
> Now, I wonder what benefit I would gain from learning Haskell since I mainly write codes for numerical simulations/data analysis.
> I know Haskell is gaining momentum e.g. in the financial environment (I happened to see Haskell knowledge as a specification in some quant jobs) hence it must be more than suitable for numerical work and, by the little I have understood so far, it allows one to write code really resembling mathematical expressions (I was impressed by guards and curried functions).
> However, it also looks to me (correct me if I am mistaken) that Haskell is a far cry from the wealth of standard and contributed scientific modules you have in Python or R and thanks to which you do not re-implement the wheel yourself.
> Any thoughts/suggestions are really appreciated.
> Cheers
> Lorenzo
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners

More information about the Beginners mailing list