Erlang Days

I received my copy Programming Erlang: Software for a Concurrent World on Sunday, and I'm in the middle of the 3rd chapter.  So far, it's definitely intriguing.

Patrick Logan talked last week about Erlang's Secret Sauce.  I was inclined to agree with Sam Ruby's initial take, but when I thought about it, Lisps have pattern matching, Prolog is most definitely pattern driven, but Patrick's other points, in particular, the mailbox-per-process paradigm.  These are all things that you'd end up needing in a distributed system, but Erlang provides, rather than having to write and debug yourself.  Mnesia is really interesting.  I've thought for a while that maybe architectures should be cache-driven rather than DB driven - that is, you should design around in-memory data and use a DB or other file system for persistence.

That said, Ted Leung has a number of points on Erlang's drawbacks.  I've always heard the knock on Erlang's string processing; while it's conceptually clean, it has the reputation of being inefficient and difficult.  I've not gotten deep enough to know from experience; I'll find out soon enough I suppose.  The library problem is the second.  Looking through Joe's book, there's a number of places where he's doing HTTP using raw sockets.  Maybe there's a good HTTP library, with things like redirect handling, Conditional GET support, and HTTP authentication, but it's a bit scary to see HTTP sample code doing things like

ok = gen_tcp:send(Socket, "GET / HTTP/1.0\r\n\r\n")

That's really not the right way to approach HTTP.

— Gordon Weakliem at permanent link