Comment

Jan Persson

I'm not that familiar with the tools available for Perl and Ruby, but apart from the JIT (Psyco, which I think is quite unique), I wouldn't be suprised if similar tools existed for those languages, and apart from that, writing an extension module is of course always an option.

Python scripts are often constituted by a number of calls to an optimized C library, where the Python code only works as the "glue" needed to express the program logic. However, this buys us expressivity without having to pay the price of maintaining the complex low level code. John K. Ousterhout (who created TCL) has written a paper about this http://home.pacbell.net/ouster/scripting.html.

This probably the main reason that the Very High Level Languages (VHLL's) are performing as good as they are.

The same thing also apply to Java. Some of the most important classes (String is an example), is almost totally implemented with native code in C, and there is not much perfomance to be gained by making the virtual machine perform better when it comes to string handling.

Parent comment

Peter Bengtsson

A good thing about Python is the vast amount of optimisation tools like you list Jan. Does perl and ruby have this too? Python scripts full of complex regular expressions, are they really much faster rewritten in C/C++? For that kind of stuff, isn't python just a simplified API of a big fat C program?