FORGE: A File-Oriented Reflective Graphical Environment
What is FORGE?
FORGE is a language-independent, OS-independent, and GUI-independent windowing API provided as a virtual filesystem.
Instead of defining a programming interface as a set of functions, the FORGE API is a set of filing operations. FORGE is inherently object-oriented -- however, the objects are all files and the methods are POSIX filing calls.
For example, a window's title is mapped to a file named "title", whose contents are the window's title string. Writing the file sets a new title, which is visible immediately in the GUI.
Why?
By keeping GUI resources behind a user/kernel boundary, an application is not limited to running in a single process -- it can exist as a collection of cooperating programs -- or for that matter, a shell script. It can be written line by line interactively by the user with immediate feedback. Running applications can be queried and manipulated by navigating their directory structure.
Therefore, FORGE (a) provides rapid application prototyping and development, (b) makes the development of 'real' applications accessible to users competent at scripting but not programming, and (c) allows for unprecedented modularity in application structure.
How is it used?
Here's Hello World in FORGE:
cd /gui/new/port # allocate a new window port ln /gui/new/caption view # add a caption as the window's view echo Hello world > view/text # set the caption text touch window # create the window
That creates a centered, minimally sized, untitled window with the text "Hello world" at the upper left.
That's it?
Well, the text doesn't look right flush against the window border, so let's modify the previous example:
rmdir view # remove the caption from the window ln /gui/new/frame view # add a frame instead ln /gui/new/caption view/v # add a caption as the frame's subview echo Hello world > view/v/text # set the caption text again echo 4 > view/padding # set the frame's padding
That removes the caption, recreates it inside a frame, and sets the frame's padding to 4 pixels.
What implementations exist?
A prototype of FORGE is implemented in MacRelix; future plans include a port to FUSE.