RCM


The driving idea behind RCM is to create a graphical Scheme REPL. RCM will allow users to input code and execute it, just like a standard command-line REPL. However, the user directly manipulates lists and atoms with the arrow keys and/or mouse, rather than by typing parentheses. Below is a screenshot of a running prototype with the code for Euclid's algorithm, side-by-side with the same code written in standard Scheme.




(define euclid_gcd 
  (lambda (x y)
    (let ((r (modulo x y)))
      (if (= r 0)
        y
        (euclid_gcd y r)))))

(euclid_gcd 56 84)






The RCM version differs from the standard Scheme version in several different ways. RCM has two different types of lists: hlists and vlists. Hlists contain child expressions which are listed horizontally, while vlists contain expressions which are listed vertically. In the example, you can see that hlists have blue borders while vlists have green borders.

Also in the example, you will notice one list with a black border. This is the currently selected list. Both atoms and lists can be selected, and the arrow keys and pageup/pagedn keys are used to navigate around the source (and, with the CTRL modifier, to create new atoms and lists). The space bar "flips" the currently selected list (toggles it between hlist and vlist), while the enter key causes the currently selected s-expression to be evaluated and replaced with its result.

The functionality of the prototype above represents only the first stage of development of what will eventually be a complete graphical programming environment. Planned feature rollouts include:

Image data type
"Image" will be a primitive datatype just like strings, integers, floats, etc. Variables of type image will not be represented in the source code by an ID or file name; rather, the image itself will be embedded directly in the source code (i.e. you will see the image in the code editor). Image data will either be imported into the code from external files (e.g. by dragging the image file into the editor) or they will be created in the REPL by evaluating functions and special forms that return variables of type image. There will be a rich set of special forms and functions for performing functions on images such as cropping, compositing, etc.

List-based layout
In an RCM program, lists will serve a layout function similar to that of tables in HTML. Functions will exist that will "collapse" lists (remove the default margins and borders, so that the contents are stacked next to each other). This is an analog to the HTML idiom:

<table border="0" cellspacing="0" cellpadding="0">
Additional functions will allow for font selection, alignment, and margin settings.

Event handlers
Functions/special forms will be created to allow user to set up event handlers on a list or atom. When the event handler setup function is evaluated on a given s-expression, that s-expression is returned seemingly unaltered, except that it will now respond to the event. Other functions will exist to remove event handlers from an s-expression, and there will be a mechanism for inspecting/showing event handlers.

Runtime mode switch
It will be possible to distribute RCM programs as standalone executables. A mode switch hotkey, if not disabled for a given running RCM program, will allow the user to switch into REPL mode at any time for debugging (a la Smalltalk).

Quadtree menu
Holding a modifier key (such as "alt") will bring up a keyword menu containing language elements such as "car" and "let". The user will be able to use arrow keys to navigate to the desired keyword. This will save the user from having to constantly switch back and forth between the arrow keys and keyboard. The menu will be organized as a quadtree, so one of four directions is chosen each time until the keyword is selected. This will allow common sequences to be memorized by the user so that they become second nature (e.g. right, up, down = "cdr")

Mouse support
TBD. Most likely selection of s-expressions will be tied to mouse-over, and the quadtree menu will be available on right-click.

RCM is currently in development and the above features are subject to change without notice. A downloadable 1.0 version for Windows is planned for end of summer 2008. Please direct all inquiries to info@instanttheories.com.

© 2008 Jason Scherer. This web page is a publication of details of an invention and constitutes prior art for that invention. This file was last modified on Monday, 10-Mar-2008 05:03:37 MST