ALICE User Guide & Reference

# ALICE User Guide & Reference

Note: ALICE was a commercial product in the 1980s. It is now free, however no support is available.

Alice is a total computing environment that makes programming faster and easier. It is particularly geared to the educational setting (high school, college, and university), but it can also be of great help to more experienced programmers.

The heart of Alice is a program editor. Unlike a normal text editor, the Alice program editor is intimately linked to a specific programming language. The editor knows the syntax of the language and makes it virtually impossible for the user to enter a syntax error. At every stage in the programming process, users have a syntactically correct program. This is particularly helpful for beginning programmers -- instead of worrying about trivialities like unbalanced parentheses, novice programmers are freed to concentrate on what is truly important: program logic. The Alice program editor can also detect a number of semantic errors, e.g. undeclared variables, invalid operations, and so on.

The Alice environment also includes an interpreter and debugger for the programming language. The interpreter can run more quickly than other interpreters, because the program editor automatically parses user input as the program is being entered. Internally, the program is stored in a tree structure that makes the interpreter's job very easy.

The debugger is linked to the interpreter and the editor, and can make use of their facilities. As an example, Alice allows the user to ``single-step'' through a program, executing one instruction at a time. In between instructions, users can perform a large number of operations, such as printing out or changing the values of variables. This can speed the debugging process immensely, because it allows users to ``get inside'' their programs as the programs run.

As another example of the interplay between debugger, interpreter, and editor, Alice supports ``cursor-following.'' While the program is executing, the source code is displayed on the screen and the cursor moves through the code showing the instructions that are being executed. This allows the user to ``see'' the program in action. Not only is this an excellent tool for visualizing program logic, but it can also aid in locating problems in the program's code.

One of the most important aspects of Alice is the on-line HELP facility, providing help and information on all aspects of Alice and the programming language. HELP will also explain errors in full detail, and provide introductory lessons on the use of Alice.

A unique feature of the HELP system is the ``What can I type here?'' menu. This is a menu of all the inputs that are legal at a particular point in the program. If the user is about to enter a statement, Alice lists the various kinds of statements that are supported by the language. If the user is about to enter a variable, Alice lists all the variables that are currently defined at this point in the program. If the user is about to enter a subroutine call, Alice lists all the subroutines that could legally be called.

Users can either type in one of the possibilities named in the menu, or they can select one of the items using a standard menu selection technique and have Alice fill in what is desired. In this way, users can do most of their programming by menu if they want to.

Menus are an important part of the Alice user interface. Programs may be written from menus; HELP is chosen from a Help Menu; and all Alice commands may be executed from menus. Alice commands may also be ``bound'' to keys, so the commands can be executed simply by typing the appropriate key. Alice comes with a set of default bindings, but users can set up their own bindings if they prefer. Indeed, users can bind any character sequence to any key, making common operations extremely easy to enter.

All these factors combine to make Alice a unique programming and educational tool. The word ``unique'' is important. Some program editors were developed before Alice, but most of these were prototypes constructed at universities (notably Cornell). We know of no product on the market that offers the comprehensive facilities available through Alice. However, it is only a matter of time before Alice and software like it make their impact on the programming world. By offering an entirely new approach to the preparation of programs, Alice gives users the chance to concentrate on the important aspects of programming and to avoid most of the mundane stumbling blocks that often loom so large.

#### For Inexperienced Users

Beginning users may prefer to go through the Alice tutorial guide before reading this manual. The tutorial introduces the concepts of Alice in a less technical way and takes you through several sessions to show you how everything works. Once you have worked through the tutorial, you should have no trouble understanding the manual.

#### For Experienced Users

The most experienced programmers often prefer to ``leap into'' using a programming tool, experimenting on their own rather than going through the documentation first. For such people, Appendix A serves as a quick introduction to Alice, giving the bare minimum of what you ought to know before you start.

#### Demonstration Mode

Some Alice packages are equipped to run demonstrations of how Alice works. To run a demonstration session, Alice takes its input from a file named "ap1.dem" instead of from the keyboard.

There are two different ways to run a demonstration session, determined by the use of the `d` option on the command line that invokes Alice. If you say

>     alice +d

Alice will execute one operation from the demo file, then wait until you press the `[ENTER]` key. Pressing `[ENTER]` repeatedly will walk through the Alice session.

If you invoke Alice with the command line

>     alice d=2

Alice will run through the demonstration without user input, merely pausing briefly between every character read from the demo file. You may also run a demonstration by choosing the selection `Run a demonstration of Alice` from the Starting Menu of demo versions of the Alice package.

#### Acknowledgements

Many people have contributed to make Alice the system that it is. Particular thanks go to Jan Gray, David Rowley and Robert Ferguson for their programming efforts. Jim Gardner deserves special credit for his extensive work developing the extensive documentation and HELP screens.

Thanks go to Tim Teitelbaum of Cornell University whose demonstration of the Cornell Program Synthesizer inspired me to create Alice. Special thanks to Mark Horton of the University of California at Berkeley whose work in the area of syntax-directed editors was of great value.

Thanks to Doug Brown of the Waterloo Board of Education for review of the documentation and work on the textbook exercises. Thanks also to Lorne Smith and Dave Didur of the Ontario Ministry of Education for their ideas and support. Thanks to Marc Adams for testing and Tom Keith and Mike Gardi of Northern Software Limited for many useful ideas.

Brad Templeton

Looking Glass Software