D vs Go in real life, part 2. Also, Erlang.

Atila Neves atila.neves at gmail.com
Wed Dec 4 10:07:25 PST 2013


>>> What about the relative elegance/maintainability/ease of 
>>> comprehension
>>> of the different solutions?  Playing devil's advocate for a 
>>> moment, I
>>> can well understand if a preference for one language over 
>>> another was
>>> decided on the basis of its performance being good _enough_ 
>>> and the
>>> code being really easy to work with, rather than simply the 
>>> best
>>> performer.
>>
>> I can't read Erlang (yet) so I don't know about that one. The 
>> C code
>> is... well C code so not great. I have a profound dislike for 
>> Go but I'd
>> say the Go and D implementations are just as readable. Then 
>> again, I
>> wrote the D code so if I didn't think that was readable... :P
>
> How do they compare in lines of code?
>

That's hard to measure. Not only because of the standard fare 
about not counting empty lines and comments, but because of some 
other issues as well. The Erlang implementation has the unit 
tests in the same files so it's all intertwined. The Go 
implementation makes use of a repository on github, should that 
be counted? In my own case I used my D serialisation library and 
also vibe.d. I would say neither should count towards the final 
tally, but others may beg to differ.

All in all the MQTT specific parts in all 3 projects weigh in at 
around 500 - 700 total lines as measured by wc -l, if memory 
serves me correctly. I'm on another computer now and pressed for 
time.

I wouldn't be surprised if the Erlang version was the shortest at 
the end of the day. I know that the Go and D implementations are 
comparable.

Atila



More information about the Digitalmars-d mailing list