interpreter vs. compiled

castironpi castironpi at gmail.com
Wed Jul 30 00:20:04 EDT 2008


On Jul 29, 7:39 am, alex23 <wuwe... at gmail.com> wrote:
> On Jul 29, 2:21 pm, castironpi <castiro... at gmail.com> wrote:
>
> > On Jul 28, 5:58 pm, Fuzzyman <fuzzy... at gmail.com> wrote:
> > > Well - in IronPython user code gets compiled to in memory assemblies
> > > which can be JIT'ed.
>
> > I don't believe so.
>
> Uh, you're questioning someone who is not only co-author of a book on
> IronPython, but also a developer on one of the first IronPython-based
> commercial applications.
>
> I know authorship isn't always a guarantee of correctness, but what
> experience do you have with IronPython that makes you so unwilling to
> accept the opinion of someone with substantial knowledge of the
> subject?

None, no experience, no authority, only the stated premises &
classifications, which I am generally tending to misinterpret.  I'm
overstepping my bounds and trying to do it politely.  (Some might call
it learning, which yes, though uncustomary, *requires questioning
authorities*, or reinventing.)

Evidently, I have a "fundamental misunderstanding of the compilation
process", which I'm trying to correct by stating what I believe.  I'm
trying to elaborate, and I'm meeting with increasingly much detail.
So, perhaps I'll learn something out of this.  Until then...

What I know I have is two conflicting, contradictory, inconsistent
beliefs.  Maybe I've spent too much time in Python to imagine how a
dynamic language can compile.

This is from 7/22/08, same author:
> I wouldn't say "can't".  The current CPython VM does not compile
> code.  It COULD.  The C#/.NET VM does.

Three big claims here that I breezed right over and didn't believe.

> It COULD.

I'm evidently assuming that if it could, it would.

> The current CPython VM does not compile code.

Therefore it couldn't, or the assumption is wrong.  Tim says it is.
And the glaring one--

WHY NOT?  Why doesn't CPython do it?

From 7/18/08, own author:
>>
#define TOP()           (stack_pointer[-1])
#define BASIC_POP()     (*--stack_pointer)

...(line 1159)...
w = POP();
v = TOP();
if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
        /* INLINE: int + int */
        register long a, b, i;
        a = PyInt_AS_LONG(v);
        b = PyInt_AS_LONG(w);
        i = a + b;
<<

I am imagining that every Python implementation has something like
it.  If IronPython does not, in particular, not have the 'POP();
TOP();' sequence, then it isn't running on a stack machine.  Is the
IronPython code open source, and can someone link to it?  I'm not
wading through it from scratch.  What does it have instead?  Does
dynamic typing still work?

<closing hostile remark>
If you're bluffing, bluff harder; I call.  If you're not, I apologize;
teach me something.  If you can ask better, teach me that too.
</hostile>



More information about the Python-list mailing list