Re:Rewriting Playdar: C++ to Erlang, with code statistics
by evgen on Thursday October 22, 2009 @12:36AM
(#896218)
When the developer claims that Erlang only uses "slightly" more memory and is currently not optimized for efficient memory use how exactly do you get to "uses much more memory"? The difference between 10M and 2.5M for the distro size is so slight given current average broadband speeds as to not even be worth mentioning.
Re:Rewriting Playdar: C++ to Erlang, with code statistics
by dunk010 on Thursday October 22, 2009 @04:30AM
(#896381)
"not bad but not that impressive either". I think the 75% is accurate, but even at 50% it's impressive. The number of lines of code in an application makes a big difference to understanding the code and maintaining it. Erlang is just a much more modern language which benefits from having idioms which simply don't exist in c++. Another big win is erlang's message passing model which is much easier to grok and far less bug prone than threads.
Re:Rewriting Playdar: C++ to Erlang, with code statistics
by metabrew on Saturday October 24, 2009 @08:47PM
(#901095)
I'm a bit late to the discussion on HN, but I responded in comments to the article stating that I removed the ping/pong code before running sloccount for the lan plugin.
Even so, the c++ style means there will have been a slight linecount inflation.
The erlang code is also much denser. I gziped the code to compare a fairer symbol count: it's 1535b vs 2916b, a 47% saving, not bad but not that impressive either, considering the refactoring in the new code.
From user's point of view, the new distribution is 4x larger (10MB vs 2.5MB) and uses much more memory, which is a bad deal. It's OK for a developer to scratch his itch but dramatizing the benefit of such scratch doesn't help anybody.