Pilo Visual Tools for Scheme <PVTS>

An Open Source Program for Visualization of Scheme Programs

Overview

This program was conceived as a set of visual tools for supporting the learning of Scheme (functional programming).

Students who know procedural and object-oriented languages frequently have difficulty learning the functional paradigm. The purpose of this work is to facilitate this transition by designing and implementing a set of visual tools that help students understand how Scheme, a functional language, programs work. To achieve our goals we worked on the implementation of a Scheme interpreter and a set of visual tools for different key aspects of functional programming languages. Pilo Visualization Tools for Scheme (PVTS) emphasizes on the functional programming language paradigm and its visual representations. PVTS can be used by teachers as a teaching tool as well as by students as a learning tool.

This research is an attempt to further develop academic tools for the functional programming language Scheme. However because Scheme is a dialect of LISP, this software can be of great value for students of LISP. The software implemented consists in a fairly complex interpreter of Scheme and a set of three visual tools. These three visual tools or aids represent three main aspects of the functional programming language: data structures and lists, function calls, and the global environment.

Conceptual Code Structure

This research is based on our own version of a limited Scheme interpreter written in Java 1.5 (see Appendix A for the complete grammar). Because the visual tools display the information that is being processed by the interpreter, they depend on capabilities of the interpreter. We needed an interpreter as functional as possible in order to run complex and varied samples of Scheme programs.

overview

Environment Viewer

The visual module for the Environments represented in the following figure is simple and to the point.

environment

Cons-Cell Viewer

This view is very simple; it has no controls and displays the list that are being processed by the interpreter.

conscells viewer

Function Call Viewer

This is the most interactive module of the three. The window looks like this.

functions call viewer

The main window (B) contains all the functions calls are represented visually. The zoom control (A) increases or decreases the size of the visual representations. In addition, an options pane (C) is available where different controls are offered in order to have the optimum visualization for a specific case. The options pane contains controls for different view modes that change the display of the ovals in the panel ; a total of four view modes are available depending on alignment and space between ovals. Also, a control for trimming the names of the functions is available as well as a control to toggle on/off the visualization of each result. In addition, the user can see the trace of the function calls in a separate window (D).

An Interesting Example

The insertion sort provides an interesting application of the Function Call Viewer.

insertion sort view