Re: ANN: CLPython



Hey Ken,

Ken Tilton wrote:
Congrats on the release. Do Python programs run as native-compiled code
or interpreted by a CL Python interpreter?

Thanks. It's all compiled to native code. A reason is that information
about e.g. variable scopes is stored in "environments" using a private
declaration type (declare (pydecl ...) ..) and those declarations are
only taken into account if the code is compiled, therefore compilation
is required before execution.

And of course compilation is for efficiency. Besides the normal work
the compiler does, there are compiler macros that save allocations of
temporary intermediate objects (e.g. bound methods) and inline of
common cases, so execution time is reduced.

Currently the execution speed varies from being on par with CPython for
numerical stuff (e.g. file b2.py from parrotbench, which in fact means
Allegro's and Python's arithmetic are about equally fast), to being up
to 3 or 4 times slower for highly "dynamic" code (in particular lots of
attribute and methods lookups, like in file b0.py). All in all not bad,
but of course we'd like to improve efficiency.

Just make sure you can run this code:

http://pyworks.org/svn/pycells/

Sure, if you promise not to use C modules...

- Willem

.



Relevant Pages

  • Re: huge array
    ... It alwasy has been run as native code. ... |> transformed from plain VB code or from any other language, ... parsing and execution are two separate steps. ... | stage of compilation - which is the generation of IL (a binary, ...
    (microsoft.public.vb.general.discussion)
  • Re: huge array
    ... or do you know a CPU which can handle something like "FOR I = 1 TO ... There is a huge difference between interpeted code and native code. ... parsing and execution are two separate steps. ... compilation happens in two phases ...
    (microsoft.public.vb.general.discussion)
  • Re: huge array
    ... Of course is always any code executing on a CPU a native code which has been ... There is a huge difference between interpeted code and native code. ... parsing and execution are two separate steps. ... stage of compilation - which is the generation of IL (a binary, ...
    (microsoft.public.vb.general.discussion)
  • Java native code compilation
    ... I was just reading some stuff on a Java forum about compilation to ... native code. ...
    (comp.lang.java.programmer)
  • Re: [SLE] Clearing up the FUD on CLI/Mono
    ... Static compilation to native code as gcj does it ... native code compilation has optimization ... For all practial purposes and for a sizeable majority of programs, Java ...
    (SuSE)