The vision of OMPC is very close to what you can read at http://www.scipy.org/PyLab
. The PyLab
project is an effort to bring together a number of powerful scientific packages for Python under a common standardized interface. OMPC has exactly the same aim, but instead of trying to work out a new interface that will necessarily have to go through a number of iterations it chooses to expose numpy/scipy/pylab function through a MATLAB(R) compatible interface. Such interface will be un-pythonic, but it should serve mostly to people coming from MATLAB(R) to Python. Experienced Python programmers can continue using the original packages.
OMPC is just a compiler. It's purpose is to translate MATLAB(R) code into Python code that can be correctly interpreted. The correct interpretation will be enabled by a library called OMPClib that will emulate some dynamic aspect of the MATLAB(R) engine that Python does not support.
OMPC is designed with a number of features in mind:
- Numpy and scipy are high level interfaces to ATLAS and some other C/FORTRAN/... libraries. It should be possible to rewrite an OMPC program into a C/C++ program that calls these libraries directly.
- OMPC should allow small optimizations of MATLAB(R) code compiled for Python, for example:
- in-place operations - execution stack lookups allow for checking if output and input arguments are the same variable
- views instead of copies - just like numpy does it
- interactive console - allow using Python with MATLAB(R) syntax
- as much as possible of the code should be in pure Python
- there should be minimum dependencies (we already have numpy, scipy and matplotlib), what can be done in Python should be done in Python, C code should be interfaced through ctypes and compiled using distutils (no makefiles, SWIG, Pyrex, scons or other beasts)
- OMPC scripts should be packagable and easily sharable as self-contained archives that depend only on Python (from the begining expecting numpy/scipy/pylab).
The OMPClib library might follow the suggestions formulated in the following documents:
- in an example - http://svn.scipy.org/svn/numpy/trunk/doc/example.py