Why C++ appears twice in the Overall rank?<br><div class="gmail_extra"><br><br><div class="gmail_quote">2012/11/20 Gregory Guthrie <span dir="ltr"><<a href="mailto:guthrie@mum.edu" target="_blank">guthrie@mum.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There is some interesting data in the article at:<br>
<br>
Code Length Measured in 14 Languages<br>
<a href="http://blog.wolfram.com/2012/11/14/code-length-measured-in-14-languages/" target="_blank">http://blog.wolfram.com/2012/11/14/code-length-measured-in-14-languages/</a><br>
<br>
basically comparing program lengths in various languages, and some ensuing discussion of how this relates to language expressiveness, etc.<br>
(He does all of his analysis in Mathematica, which is the goal of the article.)<br>
<br>
It is interesting to see how well Haskell showed in the data; and it would also be interesting to see how well it could replicate the analysis example which was a nice example of web data scraping!<br>
<br>
The data is the length of a series of programs written in a number of languages (data from: <a href="http://rosettacode.org/wiki/Rosetta_Code" target="_blank">http://rosettacode.org/wiki/Rosetta_Code</a>).<br>
(The columns don't map well to text only, Haskell column marked with ¡Ô¡Ô¡Ô¡Ô (Why doesn't this list support HTML?)).<br>
See nicer version at: <a href="http://pastehtml.com/view/ciy7woohv.rtxt" target="_blank">http://pastehtml.com/view/ciy7woohv.rtxt</a><br>
<br>
The average for Haskell of 1.89 means that on the average the same program in Haskell takes ~2x in the other languages.<br>
Given the correlation of size to clarity, complexity, effort, and errors, this is a good thing! :-)<br>
<br>
Code Size relative to Mathematica<br>
Larger numbers indicate that the language on top needs more code.<br>
<br>
C C++ Fortran Java CLisp Python C# JavaScript R MATLAB Clojure Pascal Haskell Ruby Average<br>
??????????? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ¡Ô¡Ô¡Ô¡Ô ????<br>
Mathematica 17.0 9.1 8.1 6.4 6.3 7.2 6.4 5.0 3.2 3.2 1.6 5.8 3.5 5.2 6.29<br>
Ruby 2.7 1.8 1.9 1.3 1.1 1.1 1.5 1.0 0.7 0.9 0.4 1.4 0.7 1.27<br>
Haskell 3.6 2.7 2.5 2.0 1.6 1.7 2.2 1.5 1.1 1.5 0.7 2.1 1.4 1.89<br>
Pascal 2.2 1.5 1.2 0.8 0.8 0.8 1.0 0.8 0.5 0.6 0.2 0.5 0.7 0.89<br>
Clojure 8.8 5.3 5.2 3.6 3.7 3.3 3.8 2.5 1.9 2.9 5.0 1.5 2.6 3.85<br>
MATLAB 3.6 2.4 1.8 1.1 1.4 1.1 1.7 0.9 0.8 0.3 1.6 0.7 1.1 1.42<br>
R 4.7 3.3 2.4 1.9 1.8 1.7 2.1 1.5 1.3 0.5 2.2 0.9 1.4 1.98<br>
JavaScript 2.8 2.1 1.9 1.2 1.2 1.1 1.6 0.7 1.1 0.4 1.3 0.7 1.0 1.31<br>
C# 2.0 1.4 1.3 0.9 0.8 0.8 0.6 0.5 0.6 0.3 1.0 0.5 0.7 0.87<br>
Python 2.2 1.6 1.5 1.1 0.9 1.2 0.9 0.6 0.9 0.3 1.3 0.6 0.9 1.07<br>
Common Lisp 2.8 1.8 1.6 1.3 1.1 1.3 0.8 0.6 0.7 0.3 1.3 0.6 0.9 1.16<br>
Java 2.1 1.4 1.5 0.8 0.9 1.1 0.8 0.5 0.9 0.3 1.2 0.5 0.8 0.98<br>
Fortran 1.4 1.0 0.7 0.6 0.7 0.8 0.5 0.4 0.6 0.2 0.8 0.4 0.5 0.66<br>
C++ 1.4 1.0 0.7 0.6 0.6 0.7 0.5 0.3 0.4 0.2 0.7 0.4 0.6 0.61<br>
C 0.7 0.7 0.5 0.4 0.5 0.5 0.4 0.2 0.3 0.1 0.5 0.3 0.4 0.41<br>
???????????? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ¡Ô¡Ô¡Ô¡Ô ????<br>
Overall: 4.1 2.58 2.3 1.68 1.56 1.61 1.85 1.27 0.85 1.14 0.41 1.86 0.83 1.29<br>
<br>
Overall Ranking:<br>
Clojure 0.41<br>
Haskell 0.83<br>
R 0.85<br>
MATLAB 1.14<br>
JavaScript 1.27<br>
Ruby 1.36<br>
Common Lisp 1.56<br>
Python 1.61<br>
C++ 1.68<br>
C# 1.85<br>
Pascal 1.86<br>
Fortran 2.33<br>
C++ 2.58<br>
C 4.09<br>
-------------------------------------------<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div title="signature"><p>Feng, Boqun<br>School of Software£¬Shanghai Jiao Tong University</p></div><br>
</div>