Friday, December 14, 2007

Matlab Competitor? How about Eclipse & Python

Recently Sage was release to compete against Matlab, Mathematica et al. I had a quick try of it but back out. It quickly became difficult to do much. While I am sure it is very powerful math program, its got a long, long way to go before it offers serious competition to Matlab.

I think a better Matlab-killer is the combination of Eclipse & Python. Eclipse provides the visual IDE of Matlab and Python is an excellent scripting language that can easily replace m.files. All that needs to be done is bundle plotting into Eclipse (something it should have anyway), toss in a large library of numerical and symbolic python functions (complied or C) and you have a program that can successfully compete against Matlab and Mathematica.

Having been essentially using Eclipse and Python this way for the last few days I am convinced it is a very workable solution. Why re-invent the wheel?

Tags: Matlab, Mathematica, Eclipse IDE, Open Source, Sage Math, Python


Anonymous said...

Could you expand on the difficulties you found with using Sage?

Anonymous said...

This is interesting that you're using python and Eclipse together. Sage has many python numerical libraries already built in. Can you run Sage from Eclipse? I'm sure the development team would like hearing your experiences of running Sage in Eclipse. I know that there is work being done to build IDEs for Sage other than the default notebook one. If you wanted to do one in Eclipse, that could be pretty powerful.

CH said...

... toss in a large library of numerical and symbolic python functions (complied or C) and you have a program that can successfully compete against Matlab and Mathematica.

That's precisely what Sage is about - glue to the best open source mathematics libraries like GAP, Pari, GMP, etc.

Anonymous said...

I think you don't understand what SAGE is about...

mosi said...

... toss in a large library of numerical and symbolic python functions (complied or C) and you have a program that can successfully compete against Matlab and Mathematica.

That`s exactly the point.
Why do you think Matlab is so successful? Python - batteries included - is viable for the tasks of mathematics e.g. with SciLab. However, what makes Matlab tick and Python <=2.6 "fail" in popularity is the myriad of toolboxes, easy matrix input, quick plotting, nice IDE with debugging, easy syntax for numerical computing, centralized repository with excellent documentation.
Python is one (half) level down from Matlab, and thus, much more powerful. It`s comparing apples against pears. A fair comparison would be the underlying programming language of Matlab (Java, C++ w. Atlas) vs. Python. Or Python + SciLab + gnuplot + WingIDE +++ vs. Matlab. And to program that would be a titanic quest worth a commercial pursuit.

Ariel Balter said...

Actually, I have been thinking the same thing myself. Some of the things that make Matlab great are:
(1) Easy scripting
(2) Optimized for vector and matrix data types both in performance AND programming syntax.
(3) Interactivity
(4) Optimized libraries
(5) A well designed and easy to use IDE.
(6) Immediate accessibility to numerical data oriented actions: calculations, special functions, plotting, solving, etc.
(7) Seamless integration between numerical and symbolic computation.

It is probably not possible to have all of these things simultaneously with Python. However I think one could use the Eclipse RCP to recreate an IDE environment similar to Matlab. By using Sage as the standard interpreter, one would have mathematical operations at your finger tips.

Direct, intuitive access to all the functions and operations one might want would still take some work and thought. This is particularly true for data display.

I think Python does have some features that Matlab lacks that would be nice in a numerical environment:

(1) Keyword Arguments. Since programming in Python, I've really come to hate
set('linewidth', 5, 'color', red, ...) etc.

(2) Operation Overloading. It would be nice to be able to create special data types that have operations not already planned out by Mathworks. For one example, I've had the idea of implementing some sort of "Einstein Notation" multiplication in which you could multiply and sum over a specified index.

(3) Object oriented programming in general. Objects are great for preventing folders full of short functions.

(4) Access to better GUI libraries.

(5) OPEN SOURCE!!!!!!! If I want, I could modify standard algorithms (such as solving or fitting) instead of having to code my own. If optimization was done through SciLab and Cython, then I could modify builtin functions and recompile them to fast extensions.

(6) Completely cross-platform. Combined with (5), whatever code I write can by run by anyone anywhere.

I hope Simon or someone works on this more. I hope to make some contributions myself.

hsy said...

> Can you run Sage from Eclipse?

I haven't tested it but it shouldn't be a big problem. The important point is to use Sage's python in it's environment. I think you have to do this: 1. run "./sage -sh" to enter sage's environment with it's python. 2. run eclipse there, python development should now see sage's python 3. "from sage.all import *" 4. if you want to do numerical maths, do "import numpy as np" and similar for scipy. (both is included in sage)