Shin The Gin - Wouldn't it be nice for an interative environment to save its complete state into a file and restore it later?

How would one do it with Tcl?

I know Tcl has a lot of introspection capabilities, but do they enable a complete saving of states?

RS: See serializing and Dumping interpreter state

NEM: See also continuation, depending on what is meant by interpreter state.

escargo: It sounds like saving and restoring a Smalltalk workspace (or also going back a ways, an APL workspace). Squeak Smalltalk [L1 ] has workspaces.

George Peter Staplin You should be able to do essentially what Emacs does, and dump the dynamic portions of the executable image. Basically with an ELF executable you can dump the .data segment to an image file, and then restore it on the next startup. There's a little more involved, but it's definitely possible.

Lars H: This "Emacs approach" is rather crude though, GPS. Languages with poor introspection capabilities have to do it by dumping raw memory (MS Word also comes to mind), but surely Tcl can do better! (OK, sometimes speed is of the essence, but usually it's not.)


Category Concept