Hi Minh,

When I write Haskell, its because I want to write the code quickly,
not because I want it to run quickly. GHC is a wonderful compiler and
makes things go fast, but Hugs is faster at compiling, so I always use
Hugs (WinHugs in fact). If your focus is on things going fast, then
with Haskell you have to think harder to get this - but its certainly
possible, see the shootout benchmarks.

* array
Why do you want to write things with Array's - in C the default type
of everything is an Array, and you occasionally use a Linked List. In
Haskell its the opposite - linked lists are very nice and natural - I
never use arrays.

* laziness / array (again)
Laziness often makes my code go faster - because I am lazy and
Haskell's laziness means that when I combine things in just "lazy"
ways Haskell drops the things I did that were useless.

* randomIO
side-effect is nicely resolved with monad. and you have to thread your state.
if you're writing your monad or use a transformer, things are quite
explicitly (even if it's implicit in the do notation) threaded.
Yes, C is nicer for this kind of thing, in my opinion - nicer from a
practical view, even if it is pretty horrid in the end.

* generally
my general feeling for haskell vs c is:
in haskell i always have to learn new things to get my work done ;
although haskell is really easy to learn in the first step, it's
becoming increasingly hard to get what's the *trick* to do what i
want.
I think I know very few tricks, and have never felt the need to know
more. If you stick to simple Haskell it keeps your brain for other
things.

I think what you seem to be saying is that to write fast Haskell
programs requires more effort and more work than C programming?
Exactly what Haskell programs were you trying to write, and did you
try just writing them in a naive way and checking that just "simple
and stupid" doesn't give you the performance you need?

Maybe if you learnt the FFI aspects of Haskell, you could write your
code in Haskell, and then either optimise the Haskell or just give up
and move that portion to C, keeping the rest in Haskell.

Thanks

Neil
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to