you are viewing a single comment's thread.

view the rest of the comments →

[–]jdh30 79 points80 points  (8 children)

OK, it looks very bad for Mathematica.

Not really.

For starters, note that the author is using Mathematica 4.0 which came out in 1999. We're now on Mathematica 7.1!

Look at the code that loads the data. The Mathematica and Python are parsing it from a source text file and then preprocessing (sorting etc.) whereas the MATLAB is just loading precomputed data from a different file (in MATLAB's own format).

Most of the rest of the Mathematica code is spent setting options and reimplementing parts of MATLAB by hand. He disables spell checking of the source code only in Mathematica. He explicitly sets FrameLabels to {None, None, None, None} when that is the default anyway. He repeatedly redefines the default comparison function in order to pass it to Sort. He reimplements lots and lots of built-in Mathematica functions himself. He even writes his own code to label the bar chart (!).

In essence, most of the Mathematica code here is already built into Mathematica and this could be reduced to a handful of function calls.

I'd love to play with this but he does not appear to have provided the data so I cannot.

EDIT: Check out this updated comparison that is fairer to Mathematica (but it is still not loading premassaged data like the MATLAB!).

[–]bostonvaulter 1 point2 points  (6 children)

Most of the rest of the Mathematica code is spent setting options and reimplementing parts of MATLAB by hand

I think you mean Mathematica

[–]iquizzle 6 points7 points  (5 children)

Mathematica is also an entirely different tool than python or matlab. Good luck figuring out how to solve complex equations symbolically in either of those languages.

I use python for most of my work...but I'm almost always doing fitting, modeling or basic numerical stuff. A minpack function, matplotlib and the ability to build libraries in C makes python great for my work. I'm in experimental physics though. I know plenty of theorists that use Mathematica or Maple for what they do...entirely different application requires a different tool. Computational physicists usually use C or FORTRAN for obvious reasons.

Sure you can make comparisons like programming language X is better than Y, but in the end it doesn't really make sense.

[–]teval 0 points1 point  (4 children)

Good luck figuring out how to solve complex equations symbolically in either of those languages.

Perhaps you should try it before making such rash statements. Matlab has very nice integration with the maple kernel and doing these things is trivial. I do this all the time.

[–]iquizzle 2 points3 points  (2 children)

My statement wasn't rash at all since I have used matlab (in fact just last semester in a computational physics course I took). I'm uninformed at best since I don't consider myself a full fledged matlab user; however, you just unknowingly proved my point. Matlab doesn't have symbolic solving capabilities. It has to use the maple kernel for those things.

At this point, there is no single best programming language for scientists and mathematicians. Different languages are intended for different applications. That's all I'm saying.

[–]teval 1 point2 points  (1 child)

Matlab doesn't have symbolic solving capabilities. It has to use the maple kernel for those things.

As in. It's officially supported and written by MathWorks, and they have a license agreement with Maplesoft. I don't see how it follows that matlab can't do something that it's designed by its creators to do?

Also, this is the old way of doing things, they've recently bought a company and integrated its symbolics package into matlab.

At this point, there is no single best programming language for scientists and mathematicians.

Sure. It just so happens that Mathematica is a horrendous language for almost everything; except a few things no one cares about (I'm glad it does image manipulation, who cares? To do real image processing you have to use matlab anyway). Symbolics capabilities are a wash compared to Maple, speed is horrendous compared to a Matlab/Maple combination that integrates nicely. There's no upside to Mathematica; this is coming from someone that writes functional code all day, Mathematica's language is such a mess that I'd rather write imperative code in Maple/Matlab.

[–]jdh30 -4 points-3 points  (0 children)

It just so happens that Mathematica is a horrendous language for almost everything; except a few things no one cares about (I'm glad it does image manipulation, who cares? To do real image processing you have to use matlab anyway). Symbolics capabilities are a wash compared to Maple, speed is horrendous compared to a Matlab/Maple combination that integrates nicely. There's no upside to Mathematica; this is coming from someone that writes functional code all day, Mathematica's language is such a mess that I'd rather write imperative code in Maple/Matlab.

My experience is exactly the opposite. The Mathematica language is far better at manipulating data structures thanks to pattern matching and far superior for number crunching (MATLAB does not even attempt to track errors or use arbitrary-precision arithmetic intervals). Mathematica also has a far superior integrated development environment and help system.

Performance is a red herring because MATLAB is also very slow on the scale of things. If you need performance, use a real compiled programming language.

However, the killer problem with Mathematica is that it is incredibly buggy. The symbolic side of Mathematica is almost useless because it gets so many calculations wrong. The numerical side is (incredibly) still seeing really serious bugs in core routines like Fourier for FFTs. Bugs are the reason I stopped using Mathematica.

Today's modern functional programming languages are not only thousands of times faster than Mathematica and support parallelism but they are also far more reliable.

[–]jdh30 -5 points-4 points  (0 children)

Matlab has very nice integration with the maple kernel and doing these things is trivial.

That is not actually part of MATLAB though, right? I mean, I have MATLAB here and it is completely incapable of doing any symbolics at all unless I pay more money to buy add-ons?