That Ruby example clearly will not work without a bunch code (i.e., the whole of Sinatra) that's not shown, and is not part of Ruby's std-lib.
See:
http://news.ycombinator.com/item?id=1005162
but also
That Ruby example clearly will not work without a bunch code (i.e., the whole of Sinatra) that's not shown, and is not part of Ruby's std-lib.
See:
http://news.ycombinator.com/item?id=1005162
but also
Proof: if you want to measure the power of a language with this test, enforcing that everything should be in the standard lib, and a language fails at it, adding some code to the standard lib will change the power of the language, but this is not possible because the syntax, semantic and behavior of a language (i.e the language itself) is not changed by additions to the standard library.
The real test should be, "How short can you make this code using libraries available for the language which would be generally useful working on some other task as well."
What is the total LOC of the implementation, period. Remove all ambiguity.
How low do you go before you give up? Silicon atom count?
I'd say that 'LoC using a language plus common libraries at least some developers use in real projects' is the most valid thing to measure.
Anyway, LOC count is a fetish that wreakes havoc in language communities like ruby. I'd be more interested in readability and clarity. Show the code to somebody who knows the language only superficially and take the time the person needs to figure out what the code does.
There are really three, separate things under consideration here:
- What is the expressive power of the language's syntax?
- How strong is its standard library?
- How strong is library coverage for common tasks?
The first question is what the second example tries to demonstrate, i.e. "How concise could this be made in Ruby?" The second question, I agree with you mostly. There are outliers like C++ with an especially poor standard library, but in general, that doesn't speak to the language's innate power. And in the third, I hit at in the post by saying that I feel this particular task is a bit contrived with respect to Arc: it shows simplicity in things that I wouldn't necessarily look for in a web programming language, but lacks things that I would expect (i.e. the ability to connect easily to web services APIs).