2008-02-12 11:50 in /tech/erlang
Last night I talked at PDXfunc a bit about Erlang. The slides were pretty minimal, so I don’t think I’m going to post them publicly at this point. We spent more time looking at code and demonstrating features that way. I showed a very similar IRC bot as in the talk I gave to PDX.pm on POE and Erlang, although I had actually made a change that introduced a small bug (and failed to test the code before my live demo). But, this worked out to be a positive because I got to demonstrate hot code updates and fixed the bug while keeping the bot up and running. I also showed some code I’ve been working on in the last couple days, once again writing a web spider, this time in Erlang. Unfortunately, I found some problems in
xmerlthat required heinous workarounds, and I still had some bugs by the time of the talk, but I got to demonstrate the important bit, at least, which was that by replacing a single
pmap, I could make my sequential program concurrent, proven by the fact that it hit one of the remaining bugs and crashed much faster :-).
At some point soon, I’ll write more about the spider code and my experiences with
xmerl, but I want to work out the remaining bugs first.
2008-02-12 11:11 in /tech/haskell
Last night at the Portland Functional Programming Study Group, someone claimed that 90% of learning Haskell is figuring out monads. I replied back, “The problem is that the first 90% of learning Haskell is figuring out monads; the second 90% is figuring out arrows; the third 90% is figuring out monad transformers...”
In seriousness, we had a good discussion about the issues “practical programmers” have with using Haskell, which largely has to do with the need to learn seemingly irrelevant mathematical abstractions to get almost anything done. Sure, the difficulty of doing IO is vastly overblown. However, if you looks at my series on writing a web spider (1, 2, 3) you’ll see an example of this. HaXML failed, not because using monads is hard, but because properly separating pure and monadic tasks is hard. In particular, parsing a DTD is not a pure function! HXT required learning about arrows, then about derivatives of regular expressions. I ran into a problem with leaking file descriptors, which I assumed had something to do with laziness so I learned about strictness annotations, but in fact Paul Brown recently showed that it’s actually an error handling bug in Network.HTTP. I finally got a working program, which I then proceeded to never use because it takes too damn long to run and trying to figure out how to add concurrency just felt too overwhelming at that point, as it would undoubtedly require some new abstraction to learn, and I was just out of steam.