Hello,

Sometimes your hacking data at the REPL and get the live system in a state that takes alot of work to reproduce. It would be nice if the user could "rewind" back to any previous state of the repl; this state would include the global environment. Instead of just rewinding, in a graphical environment it would be nice to select a repl state and open a new graphical repl from that point. This is what I mean by "branchable repl".

This is not science fiction; I've hacked up such an environment before. Continuations in the Factor programming language contain 5 stacks:

    datastack callstack retainstack namestack catchstack

The 'datastack' the stack where you manipulate your data. The 'namestack' can be thought of as the environment. My hack involved tweaking graphical repl; each prompt was actually a button. This button was a closure with a pointer to the corresponding "current continuation". So you could scroll back in the repl history, click any prompt, and get a new repl starting at that state.

A drawback with such a system is the increased memory usage. It would be nice if the system would discard the oldest objects referenced in the repl on an as needed basis; i.e. as you cross some memory threshold.

Ed

Reply via email to