3 ms·
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
by mumrah 14y ago
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).
- carlob 14y agoMathematica 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/MathematicaAsAProgrammingLanguage.html http://reference.wolfram.com/legacy/v5/Tour/MathematicaAsAPr...
- koenigdavidmj 14y agoMaybe 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.
- mathola16 14y agoThis 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.
- btilly 14y agoNot 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.
- saraid216 14y agoThis is a potential bias that he does call out in the article.
- taliesinb 14y agoWell, 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.
- dkarl 14y agoJulia ( http://julialang.org/ 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.
- reeses 14y agoI 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.