t3x.org / t3x / t3x-manual / 3.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
2.14 The Main Program
TOC | Index | Back Next:
3.1 Meta Information

3. The Runtime Environment

Most of this chapter has been automatically generated from the structured document classes.sd which is contained in the T3X distribution archives.

There are three different types of classes: The core class, native classes and interface classes. To the user of a class, there is no difference between these types, but when implementing additional runtime classes, it is important to know the differences.

The T3X core class is in fact an ordinary interface class. However, it may contain special code to initialize the runtime environment at startup time.

The native class is the most common type. Such classes are written in T3X using the techniques described in the section about the T3X object model and modules. The major part of the runtime system is implemented this way. There is no difference between a native class and a user-defined module. Programs are linked against native classes using the Tcode linker.

Interface classes allow to add low-level (LL) functions to a program. The LL functions themselves are written in a language suitable for system-level programming. The foreign language code is compiled to a relocatable object or library. Additionally, a native interface class must be defined to describe the functions contained in the object holding the code.

A runtime class is linked into a program by requiring it either at class level or at module level. For example,

class foo(t3x, iostream)

would be the header of a class requiring the T3X core class and the iostream class, and the statement

module bar(t3x, char, string);

would require the core class plus the char and string classes.

The following runtime classes belong to the standard T3X environment:

Name Type Description
t3x core basic routines
char native character manipulation
iostream native buffered I/O-streams
memory native dynamic memory management
rtcode native Tcode instruction lookup
string native string manipulation
system interface (mostly) portable system calls
tcode native the Tcode instruction set
ttyctl interface terminal control
util native utility functions

These classes will be explained in detail in the following sections.

Previous:
2.14 The Main Program
TOC | Index | Back Next:
3.1 Meta Information