Posts Tagged ‘Thoughts’

Is Haskell really that… great as a programming language?

Friday, May 30th, 2008

Reading lots on Haskell recently I’m beginning to feel like it’s very cool from the CS point of view, but too overcomplicated from the practical one. And all attempts to prove otherwise, as far as I think of them, have failed.

I mean, you can definitely write a useful Haskell application but isn’t the cost too high? Isn’t after all its type system too restrictful? Doesn’t messing with ErrorT IO seem to be much ado about nothing?

Yes, it’s cool when you can reason about your programs in almost mathematical sense. It’s great that you can model the domain with types. It’s nice to have lazy pure code… But when you come to side-effects, stateful computation, error handling, &c simultaneously… Well it starts to feel wrong. Just wrong.

All these are just my thoughts based on short time of learning it. Maybe I’m just too stupid. Maybe I will have this “a-ha!” with Haskell sometime so everything will seem natural to me. But maybe Haskell is just too overcomplicated for actual programming.

It feels like Haskell is actually like maths. Mathematics is all very consistent, you can reason about anything there, you can prove theorems, but when things get complicated they get REALLY complicated. And there is no shortcuts or something like that. And as even tensors don’t fit in my head really well, Haskell may not too.

Think of it like having a programmer to study algebraic geometry for example. Though Haskell seems to be lots easier.

Haskell is good. Is it?

Thursday, May 8th, 2008

Working through a few tutorials and books on Haskell I think I’m starting to feel that it’s all very good until it comes to Stateful Fucking Computations.

Well, I know that I do not know Haskell. And I know that I cannot wrap may head around all of its concepts right now (Monad Transformers? Arrows for god’s sake?). But on the other hand I see how it becomes, well, almost explosionary more compilcated as you start adding Stateful Fucking Stuff. Monad + Monad + Monad Transformer + Another one… And if you just have missed somehow that you will need, e.g. ST + IO + Error, and have just implemented smth without Error… Well welcome to ErrorT rewriting of great bunch of you functions. And it doesn’t seem to be always easy.

And of course I still have troubles with types. X :: A b c d WTF? Don’t yet clearly understand the difference between type, newtype & data. Well data is for algebraic datatypes. But type and newtype do somewhat confuse me.

And actually, writing an interpreter seems to be much harder (Parsec, State, IO through most of the program, Error throwing anywhere) than writing a compiler (Parsec -> Tree, work on the tree in a purely functional manner, generate code in a purely functional matter, you will only have to handle errors somehow in a good way. But I think it’s not that hard to do this w/o using monads here, actually. And IO only for Input once & Output once, all in main :: IO ()).

Frankly, Scheme seems to be MUCH easier to grasp. But after all, that’s one of the points why I actually did start to grok Haskell.

Good luck me.