News for hackers. Stuff that matters.
Re:Code Length Measured in 14 Languages by jrajav on Wednesday November 14, 2012 @12:04PM (#4784211)
Probably could have done with a better, more visual graph than the pyramid shown throughout the article (especially when he was using Mathematica!). The trends are there but don't pop out at all, and these are very simple metrics.

One takeaway I didn't expect: Clojure is, on average, nearly as terse as Mathematica.

Also, has anyone actually used Mathematica for something aside from data processing? Like, any of the tasks you would normally use Ruby, C++, or Clojure for?

Re:Code Length Measured in 14 Languages by carlob on Wednesday November 14, 2012 @12:11PM (#4784252)
Disclosure: I work for Wolfram.

I might not surprise you to know that most of the code in Wolfram|Alpha is Mathematica code. I don't know what kind of examples you have in mind when you talk about "Ruby, C++, or Clojure", but Alpha is probably the largest Mathematica based project in production.

Re:Code Length Measured in 14 Languages by jrajav on Wednesday November 14, 2012 @12:13PM (#4784271)
I did know that a lot of Wolfram|Alpha (And Mathematica itself too, right?) is written in Mathematica code, but as mumrah points out, that only proves that it works well in production as a DSL. When I said "Ruby, C++, or Clojure," I was trying to evoke more common tasks like a desktop application, a simple server, a text-processing library, etc.

Edit: Even if Mathematica isn't technically a DSL, it certainly seems to be geared heavily towards symbolic mathematics and data processing/visualization. My question is really, how does it fare outside its element?

Re:Code Length Measured in 14 Languages by carlob on Wednesday November 14, 2012 @12:21PM (#4784313)
Yes, some parts of Mathematica are written in Mathematica, though most fast build in functions (linear algebra is one example that comes to mind) are written in faster, compiled languages.

As I said in response to mumrah, Mathematica is not a DSL. You might argue that a lot of 'library' counts as language in Mathematica, but not that you can't write general purpose applications.

Re:Code Length Measured in 14 Languages by Locke1689 on Wednesday November 14, 2012 @01:24PM (#4784648)
Mathematica is certainly a domain-specific language. Its domain is symbolic mathematics.

You may be unfamiliar with the term "DSL." It refers to a language designed for solving a specific computational task.

This was, in fact, the stated goal of Mathematica. DSL does not mean the language cannot solve other tasks, only that it was meant for solving a specific one.

Re:Code Length Measured in 14 Languages by tokipin on Wednesday November 14, 2012 @05:07PM (#4785859)
i don't think it's a DSL. its evaluation paradigm is symbolic in the same way you would say Java's paradigm is OOP, yet we wouldn't say Java is an OOP DSL even if that's true in some technical sense

in this respect i think the name "Mathematica" does a disservice to the system. originally it may have been intended for math, but in its current form it's more like a general prototyping/presentation/construction system that makes thorough use of its capacity as a research platform

Re:Code Length Measured in 14 Languages by iano on Wednesday November 14, 2012 @12:09PM (#4784238)
Maybe I'm not reading the pyramid properly, but it looks like Clojure is on average ~2x as lengthy as Mathematica? IE: The entries in the horizontal Clojure row are ~1/2 the entries in the horizontal Mathematica row.

Definitely a confusing table.

Re:Code Length Measured in 14 Languages by jrajav on Wednesday November 14, 2012 @12:11PM (#4784254)
Yep, that's how I got "nearly as terse" - It's 1x for 'All Tasks - Line count tatio' and about 1.6x for every other metric. (In the first row)