I decided to try rewriting the dgraph in haskell first. I was originally going to try ocaml first, but its syntax just rubbed me the wrong way -- I don't like using semicolons to separate list elements, and I don't like having to use separate symbols for integer and rational arithmetic (+ and +. respectively).
So far, I'm pleased with haskell. At first I tried writing it in bottom-up style, as is my habit. But after a couple hundred lines of code, I decided the ratio of signal to noise was too low. So I switched to top down. Wow! I like it! I spent about an hour figuring out how to encode things, and working through the type errors, and then of course, it just worked. Yes, I know that this is exactly what haskell is all about, so of course it worked. But it felt so good to experience it, instead of just hearing about it.
At the moment, I'm using an algorithm whose runtime I think is O(n3), so I have yet to tackle the performance issues of haskell. We'll see how long the love affair lasts once I try to address performance. I'm also somewhat disturbed by the fact that I don't really know how to estimate runtime or memory usage. I can always measure it of course, but I'm used to being able to figure it out by examining the code.
Posted on April 27, 2003 08:38 PM
More languages articles