[Stackless] Re: [Zope-dev] Zope 2.7 running with Stackless 3.0

Shane Hathaway shane at zope.com
Wed Sep 3 16:48:19 CEST 2003


Christian Tismer wrote:
> Sounds tricky, anyway. If code is changed that logically
> comes before the current line, how to get the locals
> right, or changed scope and such, without re-executing
> the code so far?

Obviously, this part can't be perfect--the computer would have to be 
even smarter than the human.  Therefore, the human should expect the 
debugger to do something as obvious as possible.  I think the debugger 
should try to resume execution with whatever locals were previously set. 
  If the user adds code to a function on or before the currently 
executing line, the debugger should warn the user that it can't 
guarantee it will work and offer the option to start the function over 
(with the original arguments).

>> So Stackless' role in all of this is essentially the ability to set the
>> f_code, f_lineno, and f_lasti attributes of a frame object, or to mimic
>> that capability in some way.  I'm not sure that anything else is needed.
>>  I wonder how difficult it would be to patch standard Python to support
>> this.
> 
> 
> Supporting this is easy for both Pythons.
> One problem with Standard Python is that
> the C interpreter is using the frame, and some
> variables are local to the C stack. Not so much
> of a problem, we just have to escape the frame,
> modify it, and restart it. This is implemented
> in a limited way for generators, and of course
> this is completey supported by Stackless. Leaving and
> re-entering frames is Stackless' job all the time.
> 
> The need to update a code object that is on the
> frame stack is in fact almost impossible without
> stackless, since all frames on the stack are on the
> C stack as well, and they are not closed. The
> nested interpreters would have to be unwound and
> re-established. This is impossible at the moment,
> or would need a larger patch. This patch exists,
> it has the name Stackless.
> As nother benefit, you can even decide to continue
> debugging tomorrow, and simply pickle your running
> program or even your whole session to the disk.

That, of course, is incredibly attractive. :-)

>> In my previous email, I was suggesting that you talk to one of the IDE
>> companies about getting *paid* (either as a contractor or employee) to
>> make Stackless the ideal platform for IDEs. :-)
> 
> 
> Now I understand, thanks a lot. I didn't remember that
> those you mentioned were commercial companies.
> I will try to make them interested, of course.

Great.  You're a very smart hacker--there's little reason you should 
have trouble finding enjoyable work.

Shane

_______________________________________________
Stackless mailing list
Stackless at www.tismer.com
http://www.tismer.com/mailman/listinfo/stackless




More information about the Stackless mailing list