[sugar] Education?

Don Hopkins dhopkins at DonHopkins.com
Tue Mar 13 16:58:36 EDT 2007


PSIBER (PostScript Interactive Bug Eradication Routines) was an 
experimental approach I took to making a visual programming interface 
and interactive debugger for the PostScript interpreter in NeWS.

The idea wasn't to invent a new visual language, just to implement a 
faithful visual representation of how the language really is, with a 
direct manipulation interface for editing data and executing code. (With 
drag and drop, pie menus, tabbed windows, direct stack manipulation, 
scaled outlines, embedded editors, etc!)

PostScript is a lot like Lisp (in some ways more so than Python), 
because PostScript programs are simply executable arrays containing 
names, literals, primitive operators, nested arrays, etc.
So a general purpose PostScript structure editor can explore and edit 
any PostScript program, or even a NeWS thread's state, dictionary stack, 
operand stack and execution stack, so it's a useful component of an 
interactive debugger.

Python AST trees might be a good way to translate back and forth between 
editable structures and Python code.
Although (since Python ASTs weren't designed to be human editable) it 
might benefit from another layer of translation to pretty them up and 
digest them, so they can be easily edited.

I think it would be wonderful to have a visual interface that faithfully 
represented the full power and semantics of Python (without trying to 
put a "kid friendly" facade over it), so you could use it to examine and 
debug any running Python program.

Of course there's still a need for many different simple 
application-specific "kid friendly" visual languages, but when you drill 
down to real code, it's best to get the real thing (full access to 
everything Python can do, visually) instead of some annoying 
watered-down half-baked ersatz Python (like "safe python" in Zope, or 
smarty templates in PHP).

    -Don

The Shape of PSIBER Space - October 1989
http://www.donhopkins.com/drupal/node/97

The Shape of PSIBER Space:
PostScript Interactive Bug Eradication Routines

Written by Don Hopkins, October 1989.
University of Maryland
Human-Computer Interaction Lab
Computer Science Department
College Park, Maryland 20742

The PSIBER Space Deck is an interactive visual user interface to a 
graphical programming environment, the NeWS window system. It lets you 
display, manipulate, and navigate the data structures, programs, and 
processes living in the virtual memory space of NeWS. It is useful as a 
debugging tool, and as a hands on way to learn about programming in 
PostScript and NeWS.

Introduction

  [Gratuitous Gibson quote omitted]

The PSIBER Space Deck is a programming tool that lets you graphically 
display, manipulate, and navigate the many PostScript data structures, 
programs, and processes living in the virtual memory space of NeWS.

The Network extensible Window System (NeWS) is a multitasking object 
oriented PostScript programming environment. NeWS programs and data 
structures make up the window system kernel, the user interface toolkit, 
and even entire applications.

The PSIBER Space Deck is one such application, written entirely in 
PostScript, the result of an experiment in using a graphical programming 
environment to construct an interactive visual user interface to itself.

It displays views of structured data objects in overlapping windows that 
can be moved around on the screen, and manipulated with the mouse: you 
can copy and paste data structures from place to place, execute them, 
edit them, open up compound objects to see their internal structure, 
adjust the scale to shrink or magnify parts of the display, and pop up 
menus of other useful commands. Deep or complex data structures can be 
more easily grasped by applying various views to them.

There is a text window onto a NeWS process, a PostScript interpreter 
with which you can interact (as with an "|executive|"). PostScript is a 
stack based language, so the window has a spike sticking up out of it, 
representing the process's operand stack. Objects on the process's stack 
are displayed in windows with their tabs pinned on the spike. (See 
figure 1) You can feed PostScript expressions to the interpreter by 
typing them with the keyboard, or pointing and clicking at them with the 
mouse, and the stack display will be dynamically updated to show the 
results.

More:
http://www.donhopkins.com/drupal/node/97



Guido van Rossum wrote:
> On 3/11/07, Andrew Clunis <orospakr at linux.ca> wrote:
>> Antoine van Gelder wrote:
>> > Don Hopkins wrote:
>> >> Of course it might just be more powerful and efficient to 
>> re-implement
>> >> something like Klik-and-Play from scratch in Python, as a plug-in
>> >> visual scripting component, which can be used to script a
>> >> HyperCard-like gui environment, and games built on top of it like
>> >> SimCity and Robot Odyssey.
>> >
>> > Anyone know the current status of being able to turn an AST tree 
>> emitted
>> > by the Python compiler module back into code after it has been 
>> modified ?
>>
>> I've been looking into this for Develop activity, but it seems that path
>> has never been explored.  Best approach seems to be to write a
>> pretty-printer to walk the tree.
>
> I'm curious about the focus on ASTs that seems apparent in this
> subthread (though I may easily be misreading between the lines :-).
> I've always been more inclined to edit the text and re-parse from
> there, as it puts the author in control of formatting, comments etc.,
> and this is how most "real-world" environments work. (Not that that
> necessarily makes it better, but neither is the opposite true.) Is
> someone willing to write up a brief comparison between the two
> approaches?
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.laptop.org/pipermail/sugar/attachments/20070313/f9c25b4a/attachment.html


More information about the Sugar mailing list