Motivation to Learn Haskell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Motivation to Learn Haskell

Lorenzo Isella
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
Reply | Threaded
Open this post in threaded view
|

Motivation to Learn Haskell

Tim Perry-2
You might find this discussion started by a skeptic interesting (I did):
http://www.reddit.com/r/haskell/comments/cs54i/how_would_you_write_du_in_haskell/


The topic is different, but the responses tell me:
- Lots of library code that I expect to be written already doesn't exist for
Haskell.
- This isn't so bad as the code you have write is relatively succinct.
- You still have to write the missing code. Which sucks (tm).


I'm using Haskell for lots of one-off data processing. It is generally quick to
develop. It generally yields type errors rather than gibberish when I write
something stupid in my code. I recommend it. But I've never used SciPy so I
can't comment on the relative depth of the libraries.

With all that said, there are are libraries with the obvious statistical
methods:
http://hackage.haskell.org/package/#cat:statistics
http://hackage.haskell.org/package/statistics
http://hackage.haskell.org/packages/archive/hstats/0.3/doc/html/Math-Statistics.html


If you do jump in, I'd recommend the Real World Haskell book or the The Haskell
School of Expression book.

Good luck,
Tim





----- Original Message ----
From: Lorenzo Isella <[hidden email]>
To: [hidden email]
Sent: Fri, September 3, 2010 3:57:26 PM
Subject: [Haskell-beginners] Motivation to Learn Haskell

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
[hidden email]
http://www.haskell.org/mailman/listinfo/beginners

Reply | Threaded
Open this post in threaded view
|

Re: Motivation to Learn Haskell

Benjamin L. Russell
Tim Perry <[hidden email]> writes:

> If you do jump in, I'd recommend the Real World Haskell book or the The Haskell
> School of Expression book.

Another interesting title is _Programming in Haskell,_ by Graham Hutton
(see http://www.cs.nott.ac.uk/~gmh/book.html).  Duncan Coutts has
written a review on the title (see
http://www.cs.nott.ac.uk/~gmh/book-review.pdf).

As for motivation for learning Haskell, one motivator is the purely
functional nature of the language, which is referentially transparent
and therefore facilitates reasoning about programs.  Haskell has roots
in category theory, and therefore, it is frequently possible to use
category-theoretical reasoning to reason about the correctness of
programs; this cannot be said of most other programming languages.

-- Benjamin L. Russell

>
> Good luck,
> Tim
>
>
>
>
>
> ----- Original Message ----
> From: Lorenzo Isella <[hidden email]>
> To: [hidden email]
> Sent: Fri, September 3, 2010 3:57:26 PM
> Subject: [Haskell-beginners] Motivation to Learn Haskell
>
> 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
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners
>

--
Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile:  +011 81 80-3603-6725
"Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^

Reply | Threaded
Open this post in threaded view
|

Motivation to Learn Haskell

Rohit Garg
In reply to this post by Lorenzo Isella
I have explored the possibility of making this switch (numpy/scipy ->
Haskell) occasionally (aka - not VERY thoroughly), but a big hindrance
is Haskell's lack of a matplotlib equivalent.

LAPACK/ODE and cousins are comparatively easier to tackle using the C
FFI. But even there, absence of a SWIG module for Haskell is
inconvenient. SWIG alternatives for haskell might exist, but they
aren't as useful as SWIG for many reasons.

On Sat, Sep 4, 2010 at 4:27 AM, Lorenzo Isella <[hidden email]> 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
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners
>



--
Rohit Garg

http://rpg-314.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Motivation to Learn Haskell

asmith9983
In reply to this post by Benjamin L. Russell
My  tuppence worth is the wonderful conciseness of programs, the way
abstraction works, it  almost forces you into creating simple very testable
functions. These functions will  have a well defined uncomplicated
transformation, and as such may be re-used to build more complex functions.
As a beginner, the templtation is to resist the temptation to implemrnt
imperative code, but to link functions together in my thinking like a shell
script. With a shell script programs are stated left to right with the
output of the leftmost being fed into the next one to the right. I think
with Haskell on a similar pattern with a pipeline of functions feed from the
right-most one. The next thing is to learn associativity rules and the use
of parenthesis,  and $ operators.
Read everything on www.haskell.org.
Confuse yourself by trying to read Prelude source code!
--
Andrew Edinburgh,Scotland

On 4 September 2010 01:30, Benjamin L. Russell <[hidden email]>wrote:

> Tim Perry <[hidden email]> writes:
>
> > If you do jump in, I'd recommend the Real World Haskell book or the The
> Haskell
> > School of Expression book.
>
> Another interesting title is _Programming in Haskell,_ by Graham Hutton
> (see http://www.cs.nott.ac.uk/~gmh/book.html<http://www.cs.nott.ac.uk/%7Egmh/book.html>).
>  Duncan Coutts has
> written a review on the title (see
> http://www.cs.nott.ac.uk/~gmh/book-review.pdf<http://www.cs.nott.ac.uk/%7Egmh/book-review.pdf>
> ).
>
> As for motivation for learning Haskell, one motivator is the purely
> functional nature of the language, which is referentially transparent
> and therefore facilitates reasoning about programs.  Haskell has roots
> in category theory, and therefore, it is frequently possible to use
> category-theoretical reasoning to reason about the correctness of
> programs; this cannot be said of most other programming languages.
>
> -- Benjamin L. Russell
>
> >
> > Good luck,
> > Tim
> >
> >
> >
> >
> >
> > ----- Original Message ----
> > From: Lorenzo Isella <[hidden email]>
> > To: [hidden email]
> > Sent: Fri, September 3, 2010 3:57:26 PM
> > Subject: [Haskell-beginners] Motivation to Learn Haskell
> >
> > 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
> > [hidden email]
> > http://www.haskell.org/mailman/listinfo/beginners
> >
>
> --
> Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
> http://dekudekuplex.wordpress.com/
> Translator/Interpreter / Mobile:  +011 81 80-3603-6725
> "Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20100904/b8c7e984/attachment-0001.html
Reply | Threaded
Open this post in threaded view
|

Motivation to Learn Haskell

Greg Best-3
In reply to this post by Lorenzo Isella
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.

Cheers--
 Greg




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
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners