Re:Google paper comparing performance of C++, Java, Scala, a...
by zohebv on Friday June 03, 2011 @03:28AM
(#2615484)
One of the interesting details is that Go Pro required 786 lines of code as opposed to 850 lines of C++ code and 297 lines of Scala Pro code. Regular Go code was 902 lines. It certainly doesn't look like Go scores any expressiveness points over C++.
[ Parent
| on HN ]
Re:Google paper comparing performance of C++, Java, Scala, a...
by ianlancetaylor on Friday June 03, 2011 @09:18AM
(#2616198)
"Go Pro" is unfortunately a very misleading name. I just spent an hour cleaning up his use of Go. Nobody made any attempt to actually turn this code into a well-written Go program. I did not realize that he was going to publish it externally.
Re:Google paper comparing performance of C++, Java, Scala, a...
by LiveTheDream on Friday June 03, 2011 @09:33AM
(#2616254)
Would you consider touching up the Go version again to make it more idiomatic and well written? I'd be interested in seeing good Go examples; I'm sure many others here would as well.
Re:Google paper comparing performance of C++, Java, Scala, a...
by uriel on Monday June 06, 2011 @02:34AM
(#2623903)
The Go distribution already contains plenty of idiomatic, well written and very readable code.
Re:Google paper comparing performance of C++, Java, Scala, a...
by coliveira on Friday June 03, 2011 @09:58AM
(#2616347)
It would be interesting if you did the necessary optimization and posted your results for a better comparison.
Re:Google paper comparing performance of C++, Java, Scala, a...
by masklinn on Friday June 03, 2011 @03:39AM
(#2615501)
It is also slower than most alternatives, and is in the same (real) memory ballpark as Java.
On the other hand, it does compile fast.
Re:Google paper comparing performance of C++, Java, Scala, a...
by azth on Friday June 03, 2011 @04:37AM
(#2615589)
Keep in mind that the current Go compilers are not mature yet, and don't do any significant optimizations. The GC is pretty primitive too.
Re:Google paper comparing performance of C++, Java, Scala, a...
by masklinn on Friday June 03, 2011 @04:55AM
(#2615617)
I keep that in mind. As well as it getting slower as it starts doing useful work and optimizations, thus losing its "fast compilation" edge (which is just about its only advantage right now)
Re:Google paper comparing performance of C++, Java, Scala, a...
by supersillyus on Friday June 03, 2011 @04:19PM
(#2617838)
It's also interesting to note that it looks like he measured LOC with "wc -l", so all includes, comments (including license), whitespace, debug code, and the main are included.
LOC isn't a great metric, and the authors of this paper seem to make it worse by not measuring it very well.
Re:Google paper comparing performance of C++, Java, Scala, a...
by igouy on Saturday June 04, 2011 @10:21AM
(#2619532)
Please show that including comments, license, whitespace ... made some kind of significant difference to the comparison.
Re:Google paper comparing performance of C++, Java, Scala, a...
by cageface on Friday June 03, 2011 @03:34AM
(#2615493)
It may just be because I've been writing a ton of C++ lately, but to me the C++ data declarations are the most readable of the bunch. The stuff with iterators is much uglier, of course, but so far I like the syntax of C++ a lot better than that of Go.
Re:Google paper comparing performance of C++, Java, Scala, a...
by stephen_g on Friday June 03, 2011 @06:10AM
(#2615768)
Yep, iterators are one of the most annoying things in C++. That's why I love range for in C++0x - instead of writing this, for example:
for(std::vector<std::string>::iterator it = vec.begin(); it != vec.end(); it++)
you can just do:
for(std::string x : vec)
So awesome!
Re:Google paper comparing performance of C++, Java, Scala, a...
by dzorz on Friday June 03, 2011 @06:36AM
(#2615804)
Even better:
for (auto &x : vec) { }
Re:Google paper comparing performance of C++, Java, Scala, a...
by cageface on Friday June 03, 2011 @06:46AM
(#2615822)
I can't wait until I can start using this in XCode.
Re:Google paper comparing performance of C++, Java, Scala, a...
by dzorz on Friday June 03, 2011 @07:57AM
(#2615981)
If you compile recent clang, it supports range based for loops.
Using https://github.com/Rip-Rip/clang_complete you can use smart context-aware completion with vim/emacs.
For example if you had this code:
vector<string> vec; for (auto &x : vec) { x
and then if you typed period (.), it would show members from std::string. I'd say it works better than Intellisense (it's very precise and you use the same parser for code completion and final compilation).