New Features in TADS 3


TADS 3 is completely new version of TADS. Apart from the operating system-specific code (all of which is identical to that used in TADS 2), TADS 3 is all-new code, implemented from the ground up.

Functionally, TADS 3 has much in common with past versions. TADS 2 has been used very successfully by many game authors, and TADS 3 seeks to build on TADS 2's successes while overcoming its limitations. TADS 3 is built on the same user interface technology as TADS 2, so TADS 3 games will be able to use the familiar character-mode and HTML interpreter interfaces that current TADS games do. (This will also simplify the porting process for the new system, since it uses all of the same system-specific code that TADS 2 does.) The same debugger user interface will help programmers develop games. The TADS 3 language is mostly the same as past versions used. However, TADS 3 has several very big differences from past versions, and many minor improvements. Here's a list of some of the changes.

No built-in parser. TADS 3 does not have a built-in parser, as TADS 2 does. Instead, TADS 3 provides a set of powerful mechanisms that simplify the creation of custom parsers, and the standard library will provide a robust and extensible English parser implementation. Moving the parser out of the system and into the library provides game authors with complete control over the parser, and even complete replacement if needed.

No built-in command loop. The style of interaction with the user is up to the game to implement. The standard library will provide a default command loop implementation suitable for text adventure games, but game authors will be able to customize or even entirely replace the library version as desired. This has a number of side benefits; for example, the system never asks the user for input, hence all input operations are automatically under game/library control.

Automatic garbage collection. TADS 3 has an automatic garbage collector that keeps track of which objects are accessible and which have become unreachable, and automatically deletes unreachable objects. The garbage collector eliminates the need for the game author to keep track of memory and explicitly delete objects that will no longer be used.

More efficient dynamic memory allocation. TADS 3 is designed for efficient dynamic object creation. The overhead associated with creating a new object is very small.

Structured exception handling. TADS 3 has a Java-like exception handling mechanism that enables much simpler program structure and better error handling and recovery. In addition, all run-time errors generated by the virtual machine itself use the standard exception handling mechanism, which allows programmatic recovery from VM-level run-time errors.

True separate compilation. TADS 3 programs can be divided into any number of modules; each module can be compiled separately, and the compiled modules linked together to build the complete program. Only modules whose source has been modified need to be recompiled, speeding compilation times when building large games.

Unicode. TADS 3 uses Unicode internally for all character string operations, allowing use of any written language's characters and ensuring easy portability among all types of computers. Among other things, Unicode support allows TADS 3 to perform correct case conversions on all accented characters.

New local variables declared in for initializers. Like Java or C++, TADS 3 allows new local variables to be defined within a for statement's initializer clause.

Locals anywhere. TADS 3 allows new local variables to be declared anywhere within executable code (not just at the start of a block).

Labeled break and continue. The break and continue statements can now take an optional target label specifying which enclosing loop to break out of or continue with. Labeled break and continue targets eliminate nearly all of the remaining cases where goto is useful.

Full programmatic control over game control flow, including saving and restoring, restarting, and undo.

Improved regular expression handling, including a utility function that searches for regular expression matches in a string and replaces them with substitution text.

Improved random numbers. TADS 3 uses a better random number generator algorithm than past versions, and provides more convenient access: the random number generator can randomly pick a value from a list or from an argument list, in addition to its traditional generation of a random integer.

Arrays. The new Array datatype provides an alternative to the traditional List datatype. Arrays are more efficient for certain types of algorithms and are better than Lists for certain situations.

Floating-point numbers. The new BigNumber datatype provides floating-point arithmetic with numbers of arbitrary precision. You can use the BigNumber type for extremely large integer calculations as well as high-precision floating-point arithmetic. BigNumber includes a full suite of arithmetic and transcendental functions.

Anonymous objects, object templates, and relative containment declarations. The TADS 3 language has several new object declaration features that allow for very concise and convenient object definitions. You can define an object anonymously, which eliminates the need to name every decoration and detail object; you can create "templates," which let you assign common properties without listing their names; and you can declare an object's location relative to a recently declared object without naming the container object.

Sublists. A new utility function extracts an arbitrary sublist from a list.

Easier variable-argument handling. TADS 3 has new syntax that lets you handle arguments to a varying-argument function as a list, and to pass a list value as a varying-argument list to a function.

Anonymous functions. The TADS 3 language provides a mechanism that lets you define an in-line, unnamed function that can be passed as a callback to routines that perform iteration, enumeration, or notification. This powerful construct allows for much more concise code for many situations.

Syntax improvements. A few elements of the TADS language syntax have been modified for more consistency with Java and C++. In particular, the function definitions and method definitions now more closely resemble Java and C++ definitions. In addition, constructors can now accept arguments through the new operator.

Full ANSI C preprocessing. The TADS 3 compiler supports virtually all of the features of the ANSI C preprocessor: macros with substitution parameters, token pasting, stringizing, #if, #line. The TADS 3 preprocessor even obeys the ANSI C rules for recursive and circular macro expansions.



Copyright ©2000 Michael J. Roberts.