hide random home http://idom-www.informatik.uni-hamburg.de/Tycoon/tool/install.html (Einblicke ins Internet, 10/1995)

TooL - Up and Running

This page provides a brief introduction into the installation and usage of the TooL system. TooL is a polymorphic pure object-oriented language with classes and inductively defined subtyping rules. An overview over the TooL project can be found here. A brief introduction into the TooL language can be found here

Precondition: You must already set up a proper TeamWare environment. You should also bringover and bringoverx (if not already done):

The first time you start TooL, you must create a store and initialize the system by loading the file $TYCOON_ROOT/TooL/boot.tyc. You should also commit the changes:

  cd $TYCOON_ROOT/bootlib
  tycoon -store TooL  -bootFile tool.x -create
  DO load "../TooL/boot.tyc";
  DO saveSystem;
Once you have successfully created and initialized your TooL system store, you can quickly re-start the system with the flag '-restart':
  tycoon -store TooL -restart
At the TooL toplevel, you can do the following:
  1. Define new TooL classes:
      class A public a :Int;
    
    This code sample defines a class named 'A' with a single slot named 'a' having type 'Int', implicitely defining access methods for the slot.

  2. Define global variables:
      define x :A;
    
    This code defines a global ('pool') variable named 'x' of type 'A'. Global variables are initialized with nil.

  3. Execute TooL expressions:
      1 + 2;
    
    This TooL code sends a message with the selector '+' to the object '1', passing the '2' as an argument. This can be interpreted as a request for the receiver to add the given argument to itself. Another, presumably more interesting example is:
      x := A.new,
      x.a := 13,
      x;
    
    This code creates a new instance of class A and initializes the 'a' slot. Note that the pool variable 'x' must have been defined previously (see above).
    For even more interesting code samples, take a look at the TooL class library. Classes containing interesting code are, for example, Int, Collection, Dictionary, and ReadStream.
  4. Execute toplevel commands. Type
      DO help;
    
    for a list of available commands.
    The most prominent toplevel command is presumably the following one:
      DO check;
    
    This command triggers the TooL type checker. The system maintains an agenda of classes that should be type checked. You must explicitely trigger the type checker with the above command (the command also accepts a list of classes that should be checked, default is all classes on the agenda). You might also want to take a glance at the current agenda:
      DO printAgenda;
    
    Triggering the type checker is optional (you can run TooL programs without any type check at all) but advisable: the type checker will catch type errors that would otherwise be tedious to find by reporting errors at the place they are made (e.g. by passing a parameter of the wrong type) rather than at the place they emerge (by sending a message to an object that does not support it).
  5. Change the TooL and toplevel syntax (experts only). The TooL parser is implemented with extensible grammars.

How to build the TooL compiler

In order to build the TooL compiler (file $TYCOON_ROOT/tool.x), follow these steps:

Note: the following commands can be found within the file $TYCOON_ROOT/bootlib/tool0/script.tyc. Use your favorite text editor (presumably Emacs) and copy-paste 'em into the shell.

First, cd into the Tycoon root directory and start your TL toplevel:

  cd $TYCOON_ROOT/bootlib
  tycoon
To build the TooL compiler, type the following:
  do makeLibraries tool0;
  do make tool;
  import tool;
  tool.generateBootFile("tool.x");

Andreas Gawecki (29-Mar-1995)