Floo: A Glk-Enabled Scripting Language

by Andrew Plotkin (erkyrath@netcom.com)
    http://www.eblong.com/zarf/glk/floo/

Floo is a simple scripting language based on PostScript.

Look, I like PostScript, okay?

Well, you don't have to be like that. It's super-easy to parse and it
runs pretty fast. Sure, it's a stack-based language, like Forth, but
that's not so hard to learn.

For full documentation on Floo, see the URL shown above.

* The Name

"Floo" doesn't mean anything.

* Compiling

Since this is a Glk program, it must be built with a Glk library. See
the Glk home page at

http://www.edoc.com/zarf/glk/index.html

At the present time (Jan. 1, 1998) there are six Glk libraries
available:

    MacGlk: For MacOS
    XGlk: For the X Window System
    DOS Glk: For MS-DOS (by Matt Kimball)
    WindowsGlk: For Windows 95/98/NT (by David Kinder)
    GlkTerm: For text terminal windows, using the curses.h library
    CheapGlk: For any ANSI C environment, using the stdio.h library

Right now, only MacGlk implements Glk API 0.5, which is necessary to
build Floo. The others will be upgraded soon.

The Unix Makefile that comes with this package is designed to link any
of the Unix libraries (XGlk, GlkTerm, and CheapGlk.) You'll have to
go into the Makefile and set three variables to find the library. There
are instructions at the top of the Makefile. Then just type

    make floo

That should suffice. When the program is built, type

    ./floo filename.floo

where "filename.floo" is a Floo source file to execute.

To build this program on a Macintosh, you'll need the MacGlk library.
See the instructions that come with that. It's fairly straightforward;
compile the library, the source code, and the "macglk_startup.c" file.

* Version

 Version 0.5.0:
  First full release.
  More operators; better error-handling.
 Version 0.1.0 alpha:
  Initial alpha release (Mac binary only).

* Bugs and Feature-Lacks

Type errors in the glk opcode are not handled through the
error-handling system. They always shut down the interpreter.

Stack overflow errors are not handled cleanly.

Ought to add a way to execute strings and files.

Other PostScript operators that should be added:  type, cvi, rand, srand

Other string-style operators that might be useful:  strchr, strstr, strcut

Add user-definable dictionaries, or some other way to bind names
locally instead of globally? I've been considering a "closure"
mechanism, which would let you define environments and functions
rather like Lisp and Scheme do. It's a radical extension to the
PostScript Way, but it might be entertaining.

