[Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

minh thu noteed at gmail.com
Thu Jun 15 12:17:09 EDT 2006


hi all folks,

i'm diving into haskell for more than one year now.
the reason for that is just that i like haskell.
(i'm a computer science student)

but i consider to move back to c/c++.

here are my thoughts.
i've no specific question but i'd like to have your opinion.

here we go:
haskell is really nice : short phrased, declarative, math-feeling, the
type system ensure low bug amount (i surely forget other nice things).

but haskell is quite ugly in some way :

* array : if i want to write something involving array, i could use
list, and a lot (too much!) of array types (io/st, mutable/immutable,
c-friendly (storable).
worst, code involving one type can need to be rewritten for another type.

* laziness / array (again)
(i am biased since i have no knowledge of haskell profiling /
performance seeking)
always with array code, i was forced (maybe it's because i dont know enough)
to use iouarray : if not, performance|memory consumption were low|high.

but with iouarray, i cant use an array of MyType; i have to use an
array of (say) float (it's ok if i have only float in MyType).

that kind of thing is what i think is *really* low-level.
in c, i can have an array of what-i-want.

* 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.

but the threading of the randomIO argument is really not explicit for
me : it just means that the underlying/threaded state in the IO monad
can encapsulated a lot of things.
it feels exactly like a c function. but usually, you cant design a
c-like function in haskell (i.e. a function with state).

* more things i dont remember...

* 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.

e.g. writing myfunction x1 .. xn | x1 `seq` ... False = undefined is
not declarative
(and i still have to learn to identify where it helps and where it doesn't)

the c language take some more time to learn at the beginning but that's it!
what you can learn by after is better c programming.
there are memory management, pointers, side-effects, but you can do
what you want, it behaves as expected and you dont have to learn (in a
academic paper) how to use an array or how to do io.

:)
please don't tell me "you're stupid, go back to your c and leave this
glorious mailing list"

did you had the same feeling ? does it disappear ? how ?

thanks a lot,
vo minh thu


More information about the Haskell-Cafe mailing list