Compile Python, Matlab and Python

  • Context: MATLAB 
  • Thread starter Thread starter Winzer
  • Start date Start date
  • Tags Tags
    Matlab Python
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 8K views
Winzer
Messages
597
Reaction score
0
1) I know that python is an interpreted language. But is there a way to compile to code to make it process faster?

2) Suppose I have a huge array of data. I want to process it. If I were to run the process through python(with numpy and scipy), Matlab, and Mathematica which one would be able to process it the fastest?
 
Physics news on Phys.org
Winzer said:
1) I know that python is an interpreted language. But is there a way to compile to code to make it process faster?

You might look into http://psyco.sourceforge.net/ .
I have no experience with it. Please report back if it works.

2) Suppose I have a huge array of data. I want to process it. If I were to run the process through python(with numpy and scipy), Matlab, and Mathematica which one would be able to process it the fastest?

I think the answer to this really depends on
what specific tasks you want done
and how optimized your program is [with respect to the platform chosen].

You may have to also consider memory usage for your data (including data structures) and memory usage and overhead for the running program.
 
robphy said:
You might look into http://psyco.sourceforge.net/ .
I have no experience with it. Please report back if it works.
I think the answer to this really depends on
what specific tasks you want done
and how optimized your program is [with respect to the platform chosen].

You may have to also consider memory usage for your data (including data structures) and memory usage and overhead for the running program.
Thank you. Psyco looks very interesting. So does PyPy.

Another question is:
If compilers convert Java,C++,C to the same machine code(I don't know if they really do), and if I were to use a program to compile some Python file into machine code, could I use that code in some C++ application?
 
If you're looking to compile into an executable, and are on windows, check http://www.py2exe.org/

What do you mean by use some python code in c++? If you mean to have your python script talk with your c++ program, you can simply have them communicate through sockets.