Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Register based interpreter
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Venkatraman S  
View profile  
 More options Feb 20 2009, 1:07 pm
From: Venkatraman S <venka...@gmail.com>
Date: Fri, 20 Feb 2009 23:37:22 +0530
Local: Fri, Feb 20 2009 1:07 pm
Subject: [Python-ideas] Register based interpreter

Hi,

Has there been any discussion or effort on moving from a stack based
interpreter to a more register based one?
(my limited search in the archives did not yield me any results)

regards,
-V-

_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Rebert  
View profile  
 More options Feb 20 2009, 1:15 pm
From: Chris Rebert <pyid...@rebertia.com>
Date: Fri, 20 Feb 2009 10:15:52 -0800
Local: Fri, Feb 20 2009 1:15 pm
Subject: Re: [Python-ideas] Register based interpreter

On Fri, Feb 20, 2009 at 10:07 AM, Venkatraman S <venka...@gmail.com> wrote:
> Hi,

> Has there been any discussion or effort on moving from a stack based
> interpreter to a more register based one?
> (my limited search in the archives did not yield me any results)

It's possible PyPy will investigate that, and the Python
implementation on Parrot (which was stagnant last I checked) would
obviously be register-based, but as for CPython, I don't think it's
going to happen (at least not any time soon). The bytecode is
stack-oriented through-and-through; it'd be quite a major change to
become register-based.

Cheers,
Chris

--
Follow the path of the Iguana...
http://rebertia.com
_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leonardo Santagada  
View profile  
 More options Feb 20 2009, 2:41 pm
From: Leonardo Santagada <santag...@gmail.com>
Date: Fri, 20 Feb 2009 16:41:43 -0300
Local: Fri, Feb 20 2009 2:41 pm
Subject: Re: [Python-ideas] Register based interpreter

On Feb 20, 2009, at 3:15 PM, Chris Rebert wrote:

> On Fri, Feb 20, 2009 at 10:07 AM, Venkatraman S <venka...@gmail.com>  
> wrote:
>> Hi,

>> Has there been any discussion or effort on moving from a stack based
>> interpreter to a more register based one?
>> (my limited search in the archives did not yield me any results)

> It's possible PyPy will investigate that, and the Python
> implementation on Parrot (which was stagnant last I checked) would
> obviously be register-based, but as for CPython, I don't think it's
> going to happen (at least not any time soon). The bytecode is
> stack-oriented through-and-through; it'd be quite a major change to
> become register-based.

Antonio Cuni made some experiments on PyPy about this, If you ask at  
the pypy-dev mailing list or on irc (#pypy on freenode.net) he or  
others can explain what happened. If I remember correctly there  
weren't any significant improvements in performance as dispatch and  
memory copies is not the problem on python, the bytecodes are very  
complex.

[]'s
--
Leonardo Santagada
santagada at gmail.com

_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brett Cannon  
View profile  
 More options Feb 20 2009, 2:46 pm
From: Brett Cannon <br...@python.org>
Date: Fri, 20 Feb 2009 11:46:56 -0800
Local: Fri, Feb 20 2009 2:46 pm
Subject: Re: [Python-ideas] Register based interpreter

On Fri, Feb 20, 2009 at 10:07, Venkatraman S <venka...@gmail.com> wrote:
> Hi,

> Has there been any discussion or effort on moving from a stack based
> interpreter to a more register based one?
> (my limited search in the archives did not yield me any results)

Very limited work done way back in the day by I believe Skip Montanaro, but
it didn't get far enough for a complete implementation and it didn't pan out
anyway.

-Brett

_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antoine Pitrou  
View profile  
 More options Feb 20 2009, 2:48 pm
From: Antoine Pitrou <solip...@pitrou.net>
Date: Fri, 20 Feb 2009 19:48:53 +0000 (UTC)
Local: Fri, Feb 20 2009 2:48 pm
Subject: Re: [Python-ideas] Register based interpreter

Leonardo Santagada <santagada@...> writes:

> Antonio Cuni made some experiments on PyPy about this, If you ask at  
> the pypy-dev mailing list or on irc (#pypy on freenode.net) he or  
> others can explain what happened. If I remember correctly there  
> weren't any significant improvements in performance as dispatch and  
> memory copies is not the problem on python, the bytecodes are very  
> complex.

If bytecode dispatch were not a problem, I wonder how enabling computed gotos on
the py3k branch could yield up to a 15% overall speedup on pybench :-)

The biggest complication I can think of with a register-based VM is that you
have to decref objects as soon as they aren't used anymore, which means you have
to track the actual lifetime of registers (while it's done automatically with a
stack-based design). I don't know how much it could slow down an implementation
(perhaps not at all, if a clever implementation is devised...).

Regards

Antoine.

_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Collin Winter  
View profile  
 More options Feb 20 2009, 3:46 pm
From: Collin Winter <coll...@gmail.com>
Date: Fri, 20 Feb 2009 12:46:23 -0800
Local: Fri, Feb 20 2009 3:46 pm
Subject: Re: [Python-ideas] Register based interpreter

FYI, some relevant reading on converting a stack-based JVM to use
register-based bytecode:
http://www.usenix.org/events/vee05/full_papers/p153-yunhe.pdf

Collin Winter
_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry Reedy  
View profile  
 More options Feb 20 2009, 4:00 pm
From: Terry Reedy <tjre...@udel.edu>
Date: Fri, 20 Feb 2009 16:00:28 -0500
Local: Fri, Feb 20 2009 4:00 pm
Subject: Re: [Python-ideas] Register based interpreter

It was about 10 years ago, possibly before pydev, so google search in
c.l.p might have something.

_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Ewing  
View profile  
 More options Feb 20 2009, 4:47 pm
From: Greg Ewing <greg.ew...@canterbury.ac.nz>
Date: Sat, 21 Feb 2009 10:47:08 +1300
Local: Fri, Feb 20 2009 4:47 pm
Subject: Re: [Python-ideas] Register based interpreter

Chris Rebert wrote:
> The bytecode is
> stack-oriented through-and-through; it'd be quite a major change to
> become register-based.

Also, I have a hard time believing it would make much
difference. Python bytecodes are mostly quite large
units of functionality, so the time taken manipulating
the stack is not likely to be a significant component.

This is different from something like Java where you
have bytecodes that directly manipulate low-level things
such as integers.

--
Greg
_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Ewing  
View profile  
 More options Feb 20 2009, 4:59 pm
From: Greg Ewing <greg.ew...@canterbury.ac.nz>
Date: Sat, 21 Feb 2009 10:59:50 +1300
Local: Fri, Feb 20 2009 4:59 pm
Subject: Re: [Python-ideas] Register based interpreter

Antoine Pitrou wrote:
> If bytecode dispatch were not a problem, I wonder how enabling computed gotos on
> the py3k branch could yield up to a 15% overall speedup on pybench :-)

Perhaps there is room for a hybrid approach where you
take sequences of instructions such as

    LOAD_LOCAL x
    LOAD_LOCAL y
    BINARY_ADD
    STORE_GLOBAL z

and turn them into 3-operand macroinstructions

    TRINARY_ADD LOCAL(x), LOCAL(y), GLOBAL(z)

This would actually do all the same pushing and popping
as before (at least conceptually), but it would reduce the
number of bytecodes being executed, and therefore the number
of unpredictable branches, from 4 to 1.

So it would be kind of like a register-based instruction
set, except that there aren't any registers, so there
wouldn't be any problem with managing refcounts.

(BTW, calling them "bytecodes" might become something of
a misnomer -- they're going to be more like "longcodes".:-)

--
Greg
_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antoine Pitrou  
View profile  
 More options Feb 20 2009, 6:01 pm
From: Antoine Pitrou <solip...@pitrou.net>
Date: Fri, 20 Feb 2009 23:01:37 +0000 (UTC)
Local: Fri, Feb 20 2009 6:01 pm
Subject: Re: [Python-ideas] Register based interpreter

Greg Ewing <greg.ewing@...> writes:

> Perhaps there is room for a hybrid approach where you
> take sequences of instructions such as

>     LOAD_LOCAL x
>     LOAD_LOCAL y
>     BINARY_ADD
>     STORE_GLOBAL z

> and turn them into 3-operand macroinstructions

>     TRINARY_ADD LOCAL(x), LOCAL(y), GLOBAL(z)

I was thinking of something like that, although in a simpler form of 2-operand
macroinstructions:

BINARY_ADD 5, 8

where 5 and 8 are indices into a "super array" which would be equal to:
[local variables] + [code object constants]
(fast random access to the array would imply copying the constants table each
time a new frame is created for the given code object, but it would hopefully
remain quite cheap)

We can keep the current instruction format and address up to 256 local variables
and constants by splitting the 16-bit operand in two bytes.

The result would be stored on top of stack.
(if we want to access the top of the stack using the macroinstructions, we could
reserve 255 as a special index value for popping the top of the stack...)

Regards

Antoine.

_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Venkatraman S  
View profile  
 More options Feb 23 2009, 5:44 am
From: Venkatraman S <venka...@gmail.com>
Date: Mon, 23 Feb 2009 16:14:50 +0530
Local: Mon, Feb 23 2009 5:44 am
Subject: Re: [Python-ideas] Register based interpreter

On Sat, Feb 21, 2009 at 1:18 AM, Antoine Pitrou <solip...@pitrou.net> wrote:

> > Antonio Cuni made some experiments on PyPy about this, If you ask at
> > the pypy-dev mailing list or on irc (#pypy on freenode.net) he or
> > others can explain what happened.

Looks like there was no attempt on that front.

> The biggest complication I can think of with a register-based VM is that
> you
> have to decref objects as soon as they aren't used anymore, which means you
> have
> to track the actual lifetime of registers (while it's done automatically
> with a
> stack-based design).

I hope to take this as 'fun' project and try it out. Not sure how far i will
reach.

-V-
http://twitter.com/venkat83

_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Collin Winter  
View profile  
 More options Feb 23 2009, 7:54 pm
From: Collin Winter <coll...@gmail.com>
Date: Mon, 23 Feb 2009 16:54:56 -0800
Local: Mon, Feb 23 2009 7:54 pm
Subject: Re: [Python-ideas] Register based interpreter

I think this would be interesting to attempt. Lua switched to a
stack-based VM to a register-based VM for Lua 5.0.
http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/sblp2005.pdf includes some
benchmark numbers.

Collin Winter
_______________________________________________
Python-ideas mailing list
Python-id...@python.org
http://mail.python.org/mailman/listinfo/python-ideas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »