What is goo?
goo v. colloq. a viscid or sticky substance; sentimental tripe;
object oriented language for use in unix applications.
goo (yes, no capital 'g') is an object-oriented language designed to be
embeddable in any applications requiring an object-based script language.
It's especially aimed at applications which are expected to have long (or
infinite) uptimes and may have multiple simultaneous users.
goo is being designed by Robey Pointer, with help from Scott James Remnant
and Greg Brown. The goo compiler and libgoo library are being written by
Robey in his spare time.
What makes goo different from other embeddable script langauges?
-
goo is meant to be used by many users at once. Each user has their own
namespace and can set permissions on their classes and objects, such that
one user can design a class and then permit (or deny) other users to use
the class or even create derivatives of it.
-
A goo class can be loaded, used, and then changed and reloaded without
having to change the underlying application at all. This allows users to
fix bugs in their classes or even expand them without affecting others
(even if other people are currently using or deriving from that class).
-
All goo classes and objects are persistent -- serialized and saved to a
backing store, much like a database. The goo "world" can be distributed
across many machines, with objects migrating between machines (accessible
to all).
What did goo steal from its predecessors?
The original purpose of goo was to create a script language that could be
used as the engine for a MUD (multiuser text game). We looked at using Perl
or Java, but neither language supported everything we needed.
Perl supports OO only as a last-minute addition, sort of nailed onto the
side, and doesn't enforce any of the class attributes. Java does a lot of
what we wanted, but doesn't support multi-user operation or allow classes
to be reloaded after being modified.
As a result, goo is strongly influenced by both Perl and Java, as well as
drawing from Tcl, Ada, and C++. Some features we pulled from these languages
include:
-
Arrays and hashes are builtin constructs, as in Perl. Also, strings and
numbers are grouped together as a single variable type ("scalar").
-
Function parameters are named, as in Ada. When calling a function, you
may either give the parameters positionally (the standard way, like C) or
give them in any order and name them. This allows you to arbitrarily omit
parameters (all parameters have default values), which is surprisingly
useful for constructors, and removes the need for function overloading.
-
goo uses single inheritence with "interfaces", a concept grabbed wholesale
from Java. All objects have a known "real" type, regardless of what type
they're being used as, and this type can be queried at runtime using "is"
and "as" operators:
if (obj is TreeHouse)
or
(obj as TreeHouse).openDoor()
-
A class may be implemented entirely in C code, linked in via shared library,
much like in Tcl or Perl.
-
Exceptions and "finally" blocks are supported, but don't require a "try"
block (which makes them closer to Tcl in this respect than to Java). Any
data type (including scalar) can be thrown, as in C++. Catch and finally
blocks apply to the code block they're enclosed in.
-
Garbage collection is done, as in most interpreted languages. A form of
byte-code compilation is also done, similar to Perl & Java, to keep the
runtime as streamlined as possible.
-
Array and string "slices" are ripped off from Python, syntax and all.
Where can I get it?
Right now you can't, but soon enough you can. Our current plans are to
release it under the GNU GPL. The test application "Mr. Sparkle" is
currently (as of Mar 1999) parsing, compiling, and executing basic goo
code.
However, for the curious of you, we have released the
"goo spec". This is the document we use to draft out the
language (usually only slightly out of date with respect to the goo code).
Where can I make comments or ask Questions?
If you have any comments or questions about goo then e-mail Robey Pointer
at robey@lag.net.
Misc. Documentation
Last modified 8 Jun 1999