ColorStep

Introduction

ColorStep is a program visualization system that supports colored display of execution steps of Scheme programs. ColorStep should help students better understand advanced programming concepts such as recursion, procedures, and continuations. ColorStep is a client-server program. Its front-end is a Java applet and its back-end is a written in Perl and Chez Scheme. If you have Chez Scheme and would like to have ColorStep running locally in you school, you are welcome to download it.

A Visualization Example: Recursion

Recursion is an important programming concept. Most programming languages implements recursion using linked stack frames to keep local variables and return addresses associated with recursive calls. Since the dynamic behavior of the call stack is difficult to perceive, students often find recursion a mystery.

                    (define factorial
                      (lambda (n)
                        (if (= n 0)
                            1
                            (* n (factorial (- n 1))))))

The trace of factorial presented above solves this problem. Local variables for each recursive call are orgainzed as a colored tree and the computation to be performed after returning from resursion is naturally represented using nested and colored Scheme expressions. The value of a variable in the expression is determined by matching its color with colors of nodes in the tree. For example, the value of n associated with the outermost call is 3, since its color is yellow. A detailed explanation of this trace can be found in this paper (321k compressed postcript).

Before you start

  1. We recommand running ColorStep in Java-enabled browsers at 600 * 800 resolution.
  2. Is ColorStep's back-end server running? If not, please contect your instructor or system administrator (you should see a connection error after running the applet front-end.).
  3. The connection between an applet client and its server will time out after 15 minutes.
Running ColorStep Applet

Sho-Huan Simon Tung
E-mail:tungsh@mis.yuntech.edu.tw