[plt-scheme] DrScheme interpreter question

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Feb 3 13:40:56 EST 2008

On Feb 3, 2008, at 9:23 AM, Dave Griffiths wrote:

> Hi all,
> Is there a way to evaluate the contents of the DrScheme editor buffer
> without reinitialising the interpreter? What I'm after is a bit like a
> repl - i.e. modifying a running program in the text buffer.

Hi David -- I am responsible for the design of the current evaluation  
modes. It is based on some 15 years of experience with Emacs mode and  
partial evaluation of buffers. Dan Friedman (my PhD advisor) and I  
used to code this way together, pair programming for days on time,  
when we worked on research or on the Little books (little lisper/ 
schemer, seasoned schemer, ...).

Dan and I, too, got frustrated when we evaluated the subtle higher- 
order or call/cc-ish programs in The Seasoned Schemer. We decided to  
switch to turn "kill repl buffer, restart, and reload the chapter's  
code" into one Emacs macro.

Before that, when Bruce Duba joined me to teach intro course at Rice,  
we decided this mode was so important that we wanted to teach it to  
students. Then we watched and watched and we couldn't believe our  
eyes how bad it was. Later after we started TeachScheme! I watched  
beginners and got even more depressed with how they had no clue what  
was actually loaded into the evaluation buffer/repl.

Bruce and I started the Transparent REPL/Emacs projects (Rene  
Rodriguez was the PhD student who worked on it). In that world, we  
computed a program dependence graph to ensure automatically that the  
repl state was consistent (for some notion of consistent). Chez  
Schene, however, didn't support enoigh hooks and Rene's analysis  
stayed broken. (It's difficult to compute dependencies in a higher- 
order setting.)

The conclusion was that we'd just re-start the repl every time we  
evaluate. Students learn better, no question. Occasionally I miss the  
send-region-to-repl function from Emacs and a few others, but most of  
the time I am happy with it.

Which brings me to the central question:

  -- is it the loading of files that bothers you
  -- or is it the re-loading of the definition window that does?

The former could be addressed in the existing framework. I have been  
asking Matthew for "optimistic make" for a while. The latter is  

-- Matthias

Posted on the users mailing list.