[Python-Dev] Persistent Python - a la Smalltalk

2011-09-17 Thread Albert Zeyer
Hi,

I was thinking about a persistent Python interpreter system. I.e. you
start a Python interpreter instance and you load and create all your
objects, classes and code in there (or load it in there from other
files).

The basic idea is that you wont restart your Python script, you would
always modify it on-the-fly. Or a bit less extreme: You would at least
have the possibility with this to do this (like just doing minor
changes). Also, if your PC halts for whatever reason, you can continue
your Python script after a restart.

This goes along my other recent proposal to store the AST of
statements in the related code objects
(http://thread.gmane.org/gmane.comp.python.devel/126754). An internal
editor could then edit this AST and recompile the code object.

For the persistance, there would be an image file containing all the
Python objects.

All in all, much like most Smalltalk systems.

---

Has anyone done something like this already?

---

There are a few implementation details which are not trivial and there
doesn't seem to be straight forward solutions, e.g. most generally:

* How to implement the persistance?
* How to handle image compatibility between CPython updates? Even possible?

Regards,
Albert
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Persistent Python - a la Smalltalk

2011-09-17 Thread Guido van Rossum
[BCC python-dev, +python-ideas]

Funny you should mention this. ABC, Python's predecessor, worked like
this. However, it didn't work out very well. So, I'd say you're about
30 years too late with your idea... :-(

--Guido

On Sat, Sep 17, 2011 at 8:05 AM, Albert Zeyer  wrote:
> Hi,
>
> I was thinking about a persistent Python interpreter system. I.e. you
> start a Python interpreter instance and you load and create all your
> objects, classes and code in there (or load it in there from other
> files).
>
> The basic idea is that you wont restart your Python script, you would
> always modify it on-the-fly. Or a bit less extreme: You would at least
> have the possibility with this to do this (like just doing minor
> changes). Also, if your PC halts for whatever reason, you can continue
> your Python script after a restart.
>
> This goes along my other recent proposal to store the AST of
> statements in the related code objects
> (http://thread.gmane.org/gmane.comp.python.devel/126754). An internal
> editor could then edit this AST and recompile the code object.
>
> For the persistance, there would be an image file containing all the
> Python objects.
>
> All in all, much like most Smalltalk systems.
>
> ---
>
> Has anyone done something like this already?
>
> ---
>
> There are a few implementation details which are not trivial and there
> doesn't seem to be straight forward solutions, e.g. most generally:
>
> * How to implement the persistance?
> * How to handle image compatibility between CPython updates? Even possible?
>
> Regards,
> Albert
> ___
> Python-Dev mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: 
> http://mail.python.org/mailman/options/python-dev/guido%40python.org
>



-- 
--Guido van Rossum (python.org/~guido)
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Persistent Python - a la Smalltalk

2011-09-17 Thread Ethan Furman

Albert Zeyer wrote:

I was thinking about a persistent Python interpreter system.


python-dev is for developing the next version of Python (3.3 at this 
point).  Questions like this should go to python-list or python-ideas.


~Ethan~
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com