[Haskell-cafe] Learning C after Haskell

Chad Scherrer chad.scherrer at gmail.com
Mon Jun 12 17:39:13 EDT 2006


Thanks, Minh. So are things like recursion and memory sharing typically out
the window?

Also, I don't see how thinking about type classes will help, without the
benefits of polymorphism.

-Chad

---------- Forwarded message ----------
From: minh thu <noteed at gmail.com>
Date: Jun 12, 2006 12:23 PM
Subject: Re: [Haskell-cafe] Learning C after Haskell
To: Chad Scherrer <chad.scherrer at gmail.com>

hi,

C is very different from Haskell.
* you'lle have to manage explicitly memory de/allocation.
* c programming is a bit like haskell io monad programming (but
without the functionnal part) :
  you'lle use "=" in place of "<-" and the left hand side can be
reassigned multiple times.
* imperative programming (c is imperative) involve states (a lot !).
  (see how to write the equivalent of mapM print [1..10]);
  imperative programmers use loops, not much recursion

* things you can keep in your mind : the way you organize things
(module, type classes (but there is no polymorphism in c), have
functions and not a huge amount of code lines...), the way you use
self documenting names.

well, not sure it helps, but here you are :)
mt


2006/6/12, Chad Scherrer <chad.scherrer at gmail.com>:
> 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
>
>
>


-- 

Chad Scherrer

"Time flies like an arrow; fruit flies like a banana" -- Groucho Marx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060612/1ae12d1b/attachment.htm


More information about the Haskell-Cafe mailing list