News for hackers. Stuff that matters.
Re:Code Length Measured in 14 Languages by mumrah on Wednesday November 14, 2012 @12:10PM (#4784247)
Of course Mathematica is more succinct - it is a domain specific language, not general purpose like most of the others compared. The only meaningful comparisons to Mathematic would be R and MATLAB (other DSLs).
Re:Code Length Measured in 14 Languages by taliesinb on Wednesday November 14, 2012 @12:21PM (#4784317)
Well, it is certainly concise to represent formulae and equations in Mathematica, but that isn't what makes it a concise language.

That I think is owed to Mathematica being an heir of LISP that implemented m-expressions so cleanly that M doesn't even feel like a homoiconic language. Most other LISP-derivates (like Clojure) stuck to s-expressions, which are historical baggage more than anything else. Some day I'm sure we'll get an m-expression version of Clojure.

Of course in practice one defines new DSLs quite often in Mathematica. And it comes with a variety of DSLs "built-in", mainly for user interface construction, vector graphics, mathematics, and statistical computations.

Disclosure: I too work for WRI.

Re:Code Length Measured in 14 Languages by dkarl on Wednesday November 14, 2012 @12:54PM (#4784477)
Julia ( http://julialang.org/ ) is another homoiconic language that doesn't use S-expressions. They're both mathematical languages, so it's plausible that Julia was inspired by Mathematica in this choice, though it takes other ideas straight from Common Lisp, so maybe not.
Re:Code Length Measured in 14 Languages by carlob on Wednesday November 14, 2012 @12:13PM (#4784269)
Mathematica is not a domain specific language, otherwise many of the examples in Rosetta Code wouldn't be completed…

See this[0] for more info

[0] http://reference.wolfram.com/legacy/v5/Tour/MathematicaAsAPr...

Re:Code Length Measured in 14 Languages by koenigdavidmj on Wednesday November 14, 2012 @12:19PM (#4784304)
Maybe domain-specific is the wrong term. It's certainly a Turing complete language. But it's optimised to make a particular set of operations easier, so those operations are going to come out shorter than the same operations in a general purpose language.
Re:Code Length Measured in 14 Languages by mathola16 on Wednesday November 14, 2012 @12:23PM (#4784324)
This is only true if you think the test set in Rosette Code is biased towards the domain that Mathematica is optimized for.

There is no reason to think this looking at the website.

Since he uses median ratios, then a single spectacular ratio will not skew the results.

Re:Code Length Measured in 14 Languages by btilly on Wednesday November 14, 2012 @01:22PM (#4784633)
Not the test set in Rosetta Code.

The part of the test set that people have actually provided Mathematica solutions for. There is every reason to believe that people are more likely to provide Mathematica solutions for problems that Mathematica is likely to be good at.

Re:Code Length Measured in 14 Languages by saraid216 on Wednesday November 14, 2012 @02:35PM (#4785075)
This is a potential bias that he does call out in the article.
Re:Code Length Measured in 14 Languages by reeses on Wednesday November 14, 2012 @05:59PM (#4786077)
I would say, rather than being a DSL, the Mathematica language was informed by a particular goal. Much as Prolog, R, RPG, Perl, job control shells, etc., were born of a need to 'scratch an itch' and have found themselves pushed beyond that initial itch, Mathematica's Lisp-like syntax, pattern matching, term rewriting, and functional programming capabilities have resulted in a number of applications written by people who each push mma just a little bit further.

Most of these apps come from people in the target market, but it's similar to the number of Excel spreadsheets that end up running surprisingly large companies. A "non-programmer" develops a bunch of macros and VBA code to make their job easier, and those "DSL" type capabilities become critical core aspects of the system.