[Haskell-cafe] Learning C after Haskell

Graham Klyne GK at ninebynine.org
Thu Jun 15 17:23:23 EDT 2006

I did the transition the other way, and even now the real-world keeps me using
more C-like languages (Java, Python).

Unlike the transition from imperative languages to Haskell, I don't think
there's much you have to unlearn or rethink.  But I suspect you may feel a
degree of frustration at how incredibly primitive C may seem after learning to
use the power that Haskell makes available.  Where you can map Haskell idioms
into C, I think they may serve you well (I've found this to be the case with
Python, but the gap from Haskell to C is somewhat greater).

You mention "high performance" computing.  I think there are two ways of
achieving this:  the C way might be described as "micro optimization" -- getting
the small but important things to run as efficiently as possible  The Haskell
was is more a case of "macro optimization" -- getting the overall algorithmic
approach to be as smart as possible.  There's a place for both, but once you get
involved in micro-optimization it can be very difficult to go back and fix the
macro performance issues.  So you might do well to first code algorithms in
Haskell first, and experiment with the algorithms, if only as a way of
specifying the solution to be implemented in C.


Chad Scherrer wrote:
> Ok, so I'm doing things somewhat backward. I've been using Haskell for a
> while now, whenever I get a chance to. But in order to become more
> involved in high-performance computing projects at my work, I need to
> learn C.
> I've heard a lot of people say that experience in Haskell can improve
> one's abilities in other languages, but I also wonder how different the
> C "way of doing things" is different from Haskell's.
> My question is, as I learn C, are there any particular Haskell concepts
> I should keep in the back of my mind, or is it better to approach C from
> scratch?
> Thanks in advance!
> Preparing for a foot-shooting,
> Chad
> ------------------------------------------------------------------------
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Graham Klyne
For email:

More information about the Haskell-Cafe mailing list