Sunday, December 14, 2008

Erlang is great stuff!

Following up on Erlang is Interesting and Heartfelt thanks for the Erlang tips!

I have completed the reimplementation of what was about 20kloc of C/C++ (15kloc of which being an SDK of which I actually used only about half the capabilities of), in just over 1kloc. I could probably refactor/rewrite the C/C++ to reduce it in size by a factor of 3-4 -- I have an approximately 1kloc replacement for the parts of the SDK I actually use -- but there is a limit around that mark where the amount of code needed just to placate the Win32 gods applies a hard lower bound for the tout ensemble.

And not only is it shorter (a big win for keeping what's going on in your head in the first place), using the right language for the job means that the threading story is far clearer, too. And, as an unlooked for bonus, the whole thing (a protocol terminating data pump) performs far better under load, without being at all resource heavy.

Given the choice, I don't think there's another platform that I'd choose for doing such bits of network plumbing infrastructure.

1 comment :

Maxim Kharchenko said...

I totally on your side that Erlang is a great stuff. It shines when you need to implement a protocol layer, a parser or a web service. Erlang definitely increases the productivity of a programmer by effectively reducing the space of possible interactions a programmer should keep in his or her mind while writing code.