First impressions

Last modified Aug. 21, 2007 | Revision 13

Brehauts thoughts:

Matt and I are playing around with a little game project consisting of a Python / PyGame client and a server implemented in Erlang. Most of the logic and game model is implemented in the server.

Pros

  • Symbolic programming – Lots of nice fu involving pattern matching. Familiar from Prolog and Haskell, probably my favorite aspect of the language. In particular the use in message passing and cases.
  • Readable – The code proves to be fairly readable, even for a novice. I think symbols and lack of inline error checks help a lot.
  • Concurrency – This is a huge win for what we have been writing. Snapping together a multiplayer scalable server without having to worry about complex multi-threaded crap is great.
    • I think one of the biggest wins from this is the fault tolerance and hot code swapping support - its partly a byproduct of the functional nature as well, but its hella nice.
  • Binaries – The Bit Syntax for pattern matches on binaries is probably one of the coolest tricks for decoding protocol information from the wire. Eg: <<ContentLength:16,Data:ContentLength/binary, Remainder/binary>> matched against a binary blob will extract the first 2 bytes as ContentLength, then try to take a block ContentLength bytes long as Data, with any remaining data as Remainder.

Cons

  • Strings – The language shows its age most here. While servicable (and definately more so than C etc) not as nice as im used to in a dynamic language. regexp package in particular is quite minimal.
  • I have mostly been working on things that are clearly erlang’s forte, it will be interesting to see what cons i discover as i venture into other areas.

brehaut think’s he might have swallowed the Kool Aid. just a bit

Last modified Aug. 21, 2007 | Revision 13