[OT] Compilable Python-like language?

François Pinard pinard at iro.umontreal.ca
Tue Mar 23 09:47:35 EST 2004


[Ed Cogburn]

> By compile-to-binary, I meant create a binary executable in native
> machine code that does not involve an interpreter process (source or
> byte-code), and any substantial run-time overhead.  In other words my
> concern, is as always, about speed.

Clear enough! :-)

> Lisp has good performance, and is a compilable language, I'm aware
> of that, but I just can't handle all the parentheses [...] without
> getting a headache. :) To each their own, I need something else.

While I quite understand what you mean (my initial LISP experiences
were on punched cards, so human balancing of parentheses at the time
ought to be an clever efficient art), Lisp (the capitalisation changed
since then!) became much more manageable.  With intelligent editors,
able to automatically re-indent on the fly (on Unix, Emacs is the only
one I used, but there might be others able to do so), you merely look
at the indentation.  And for the remaining few times you still need to
look at parentheses, within a single line usually, the corresponding
parentheses blink while you move the cursor.  All in all, in real
day-to-day practice, parentheses are not an impediment anymore.  Given
you use a proper editor, Lisp might be even easier overall than many
other languages.  You should not fear it.

> Pyrex is very interesting, I've looked at Pyrex code.  The purpose
> of Pyrex however isn't to replace Python or the interpreter process,
> merely to optimize some parts of a Python program.  Even with heavy
> use of Pyrex, you still can't get away from the interpreter process,
> ie., Python will always have to be there, right?

I'm not sure.  In one of my projects, I want to explore how fully one
could get rid of the Python interpreter while using Pyrex, maybe through
a set of added stub routines, but this project is low priority and I'm
not getting there yet.  One of these days hopefully.  The nice thing
with Pyrex is that you can use the Python interpreter, or not use it,
more or less depending on your way to declare things and your way to
code.  So, in a way, you have full control over the compromise between
speed and facility.  The temptation is always strong to use Python
facilities, but I guess that with enough discipline, you can displace
and put the equilibrium wherever you want.

If you tolerate having the Python interpreter around, I presume that you
can take good advantage and be happy of its presence for the many parts
of your programs where speed is not that critical.  If you do not want
the Python interpreter around in the long run, and if this is possible
to fully get rid of it (I do not know yet), then there is no doubt to me
that one needs a fairly strict discipline while using Pyrex.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list