[Python-ideas] Re: Looking for people interested in a Python register virtual machine project

Guido van Rossum guido at python.org
Tue Mar 23 18:25:33 EDT 2021


On Tue, Mar 23, 2021 at 12:40 PM Skip Montanaro <skip.montanaro at gmail.com>
wrote:

> I've not attempted to make any changes to calling conventions. It
> occurred to me that the LOAD_METHOD/CALL_METHOD pair could perhaps be
> merged into a single opcode, but I haven't really thought about that.
> Perhaps there's a good reason the method is looked up before the
> arguments are pushed onto the stack (call_function()?). In a
> register-based VM there's no need to do things in that order.
>

IIRC the reason is that Python's language reference promises left-to-right
evaluation here. So o.m(f()) needs to evaluate o.m (which may have a side
effect if o overrides __getattr__) before it calls f().

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>


More information about the Python-list mailing list