Using Python for programming algorithms

sturlamolden sturlamolden at yahoo.no
Wed May 21 13:50:53 EDT 2008


On May 21, 11:59 am, Bruno Desthuilliers <bruno.
42.desthuilli... at websiteburo.invalid> wrote:

> Strange enough, no one calls Java or C# 'interpreted languages', while
> they (or, to be more exact, their reference implementations) both  use
> the same byte-code/VM scheme[1].

Java interprets the bytecode in a virtual machine by default. Only
code 'hotspots' are JIT compiled to native machine code.
Microsoft .NET compiles bytecode to native code on the first
invocation, and caches the machine code for later use. Nothing is
interpreted.

Java can benefit from more runtime information when generating machine
code, but incurs the penalty from running an interpreter most of the
time. MS .NET is more similar to a static compiler. They currently
perform about equally well, sometimes approximating traditional
compiled languages like C++.

But they do not use the same bytecode VM scheme. Particularly,
Microsoft .NET has no virtual machine.

> You know, Common Lisp is also an highly dynamic language, and there are
> now some optimizing native-code Common Lisp compilers that generate very
> efficient binary code. It only tooks about 30 years and way more
> ressources than CPython ever had to get there...

The speed of Common Lisp with compilers like SBCL and CMUCL comes from
optional static typing. This no more magical than what Cython and
Pyrex already can do. If we remove the interpreter when Cython or
Pyrex supports all features of the Python language, and instead rely
on "JIT compilation" by one oth these compilers, we are already there.







More information about the Python-list mailing list