Skip to main content
Cite the MATLAB answer
Source Link
schneiderfelipe
  • 1.7k
  • 1
  • 11
  • 29

Cython

There are currently two answers suggesting Python (by Paulie Bao and Greg). Python is a high-level, interpreted, dynamically typed, garbage collected, and general-purpose programming language. All this means is that you can have an actually working, readable piece of code in a considerably short amount of time and that this code can do pretty much anything (from machine learning to convex optimization to parsing computational chemistry logfiles).

But coding faster does not mean fast code. This has been argued in other answers, particularly in the context of compiled (e.g. C/C++/Fortran/etc.) versus interpreted languages (such as Python, see answers by taciteloquence, Antoine Levitt, DetlevCM, Camps♦, etc.). Of course, you could try to avoid this discussion by using the many Python libraries that actually wrap C/C++/Fortran codes, such as NumPy or SciPy; this is probably fine for using Python as an (excellent) replacement for MATLAB/Octave (see this answer as well), but this might not be enough. What if we could compile Python? Better yet, what if we could only compile the bottlenecks?

Cython can be described as a C/C++-compiler for Python. You can either compile pure Python code (for which you can expect a 30-40% performance boost) or an annotated version of it (for which you might not see a difference from pure C). The good thing is that the compiled modules are fully interoperable with the Python ecosystem.

Cython

There are currently two answers suggesting Python (by Paulie Bao and Greg). Python is a high-level, interpreted, dynamically typed, garbage collected, and general-purpose programming language. All this means is that you can have an actually working, readable piece of code in a considerably short amount of time and that this code can do pretty much anything (from machine learning to convex optimization to parsing computational chemistry logfiles).

But coding faster does not mean fast code. This has been argued in other answers, particularly in the context of compiled (e.g. C/C++/Fortran/etc.) versus interpreted languages (such as Python, see answers by taciteloquence, Antoine Levitt, DetlevCM, Camps♦, etc.). Of course, you could try to avoid this discussion by using the many Python libraries that actually wrap C/C++/Fortran codes, such as NumPy or SciPy; this is probably fine for using Python as an (excellent) replacement for MATLAB/Octave, but this might not be enough. What if we could compile Python? Better yet, what if we could only compile the bottlenecks?

Cython can be described as a C/C++-compiler for Python. You can either compile pure Python code (for which you can expect a 30-40% performance boost) or an annotated version of it (for which you might not see a difference from pure C). The good thing is that the compiled modules are fully interoperable with the Python ecosystem.

Cython

There are currently two answers suggesting Python (by Paulie Bao and Greg). Python is a high-level, interpreted, dynamically typed, garbage collected, and general-purpose programming language. All this means is that you can have an actually working, readable piece of code in a considerably short amount of time and that this code can do pretty much anything (from machine learning to convex optimization to parsing computational chemistry logfiles).

But coding faster does not mean fast code. This has been argued in other answers, particularly in the context of compiled (e.g. C/C++/Fortran/etc.) versus interpreted languages (such as Python, see answers by taciteloquence, Antoine Levitt, DetlevCM, Camps♦, etc.). Of course, you could try to avoid this discussion by using the many Python libraries that actually wrap C/C++/Fortran codes, such as NumPy or SciPy; this is probably fine for using Python as an (excellent) replacement for MATLAB/Octave (see this answer as well), but this might not be enough. What if we could compile Python? Better yet, what if we could only compile the bottlenecks?

Cython can be described as a C/C++-compiler for Python. You can either compile pure Python code (for which you can expect a 30-40% performance boost) or an annotated version of it (for which you might not see a difference from pure C). The good thing is that the compiled modules are fully interoperable with the Python ecosystem.

Source Link
schneiderfelipe
  • 1.7k
  • 1
  • 11
  • 29

Cython

There are currently two answers suggesting Python (by Paulie Bao and Greg). Python is a high-level, interpreted, dynamically typed, garbage collected, and general-purpose programming language. All this means is that you can have an actually working, readable piece of code in a considerably short amount of time and that this code can do pretty much anything (from machine learning to convex optimization to parsing computational chemistry logfiles).

But coding faster does not mean fast code. This has been argued in other answers, particularly in the context of compiled (e.g. C/C++/Fortran/etc.) versus interpreted languages (such as Python, see answers by taciteloquence, Antoine Levitt, DetlevCM, Camps♦, etc.). Of course, you could try to avoid this discussion by using the many Python libraries that actually wrap C/C++/Fortran codes, such as NumPy or SciPy; this is probably fine for using Python as an (excellent) replacement for MATLAB/Octave, but this might not be enough. What if we could compile Python? Better yet, what if we could only compile the bottlenecks?

Cython can be described as a C/C++-compiler for Python. You can either compile pure Python code (for which you can expect a 30-40% performance boost) or an annotated version of it (for which you might not see a difference from pure C). The good thing is that the compiled modules are fully interoperable with the Python ecosystem.