Oberon-2 and Modula-2 Technical Publication
Ubaye's First Independent Modula-2 & Oberon-2 Journal! Nr. 1, Feb-1996 (2nd ed. Aug-96)
The XDS Development System
[Ed. note:] Information provided courtesy XDS, Ltd., March-1996
XDS (eXtended development system) is a portable bilingual programming system
featuring Modula-2 and Oberon-2 languages. XDS provides the same
programming environment for all popular platforms: MS/DOS, Windows 95,
Windows NT, OS/2 and various Unix systems.
There are two XDS packages
Both variants of XDS use the same platform independent front-end that
performs all syntactic and semantic checks in the source program providing the
same ISO standard Modula-2 and Oberon-2 source languages for all platforms.
XDS Project Management subsystem helps programmer to maintain large
projects. Each package also contains a set of standard, run-time system as well
as machine/operating system specific library modules.
- translator to ANSI-C
- native code compiler for Intel 80x86 (386 or higher) processors.
The XDS translator produces output in the form of C source code, suitable for
compilation with an appropriate C compiler. All popular C/C++ compilers are
supported (Watcom, Symantec, Borland, GNU). The target language of the XDS
translator can be chosen to be either Kernighan & Ritchie C, ANSI C or C++.
The readability of the generated code is improved by preserving source
comments and providing appropriate text formatting.
Debugging facilities of XDS translator consists of a built-in post-mortem history
analyser and an external debugger support. The post-mortem analyser resides
in XDS runtime and displays the procedure call chain when the program
terminates abnormally. XDS supports external debuggers by inserting
appropriate "#line" directives into the generated text. These directives force the
debugger to operate on the Modula-2 or Oberon-2 source instead of its
intermediate C representation.
The XDS native-code compiler produces highly optimized code for Intel80x86
processors. Programs compiled with all possible Modula-2 runtime
checks (such as NIL dereference check, unsigned overflow check, array bounds
check, etc.) enabled, run only approx. 10% slower than with all checks disabled. So
run-time checks may be kept even in the final application program thus
The native XDS provides a good integration of "native"
programs with "foreign" (e.g. written in C) procedures. It supports calling and
naming conventions for popular C compilers.
Native XDS compiler and linker provide debugging information in CodeView
format allowing to use any compatible debugger.
The XDS Modula-2 compiler in a standard mode complies with the International
Standard (ISO 10514). Special compiler options provide some language
XDS Oberon-2 compiler in a standard mode is fully compatible with ETH
compilers. It also has a number of language extensions:
- SHORT and LONG forms of CARDINAL and INTEGER
- Conditional compilation preprocessor
- Foreign (C/C++ and Assembler) interface
XDS Modula-2 and Oberon-2 compilers share the same symbol file format.
Modula-2 modules can freely be imported from Oberon-2 and vice versa without
any special efforts. Both compilers accept a set of language extensions
supporting a mix of Modula-2 and Oberon-2 as well as import of modules from
other programming languages.
- Full access to imported objects of Modula-2 types
- Conditional compilation preprocessor
- Foreign (C/C++ and Assembler) interface
XDS Project Subsystem simplifies management of large projects. Project can be
described in special project files containing the following information:
To produce a consistent target of the project XDS Project Subsystem performs
- Source and target files location (search paths, redirection)
- Compiler option settings specific to the project
- List of modules constituting the project
If project file is set up properly and no compilation errors encountered then the
path from source modification to updated target is done in one step.
- The Project Subsystem
completes modules list using import information of explicitly given modules
and search paths directives of the project file. No need to enumerate all "native"
modules of the project in the project file. It is sufficient to point the main module
of the project and properly set up project's search paths. "Foreign" modules
(from C or Assembler) should be explicitly listed.
- It checks dependencies between project's modules and determines correct
order of modules compilation. It also checks modification dates of source and
target files and determines which modules need to be recompiled to get
consistency (similar to any "make" utility).
- It runs Modula-2 and Oberon-2 compilers against modules which need
- It generates make script or linker response file depending on project settings.
- It runs the make utility or linker depending on project settings.
XDS libraries set
Note that Modula-2 libraries are freely accessed from Oberon-2 modules.
- Full set of ISO 10514 libraries including string manipulation, memory
management, input/output, exception handling, coroutines, processes and
- Subset of PIM libraries (libraries defined in N.Wirth's book
"Programming In Modula-2")
- POSIX interface definition modules
- Utility libraries
- Oberon-2 run-time support including garbage collector and meta-language
facilities such as dynamic type identification, command invocation,
objects finalization etc.
History of the XDS project
The XDS project was started in 1991. The goal of the project was to construct a
portable programming environment for a variety of platforms. Modula-2 was
chosen as a safe language suitable for application programming as well as for
programming of embedded systems. Oberon-2 was chosen because it is the
object-oriented successor of Modula-2.
In 1992 the first version of the system was implemented. It contained Modula-2
and Oberon-2 translators to ANSI C. The product was called OM2.
In the fall of 1993 two other tightly coupled products were ready:
The compilers were written in Modula-2. Mithril was written in Oberon-2. Early
1994 the development of second generation compiler was started. The main
To satisfy these requirements the compiler kernel was rewritten in Oberon-2. A
new object-oriented compiler architecture was introduced providing clear
separation of front-end and back-end development as well as tight cooperation
of these components in the compiler. A flexible internal program representation
was developed in order to support compilation of other high-level programming
languages. The run-time system for Oberon-2 was redesigned to allow portable
and efficient garbage collection and meta-language facilities. The version 2.03
of the XDS translator was released in the fall of 1994. At the same time, the
development of the native-code compiler was started. The main goals were
- To improve portability of the system
- To achieve International Standard (ISO 10514) compliance of the Modula-2
compiler and libraries.
- To improve Oberon-2 run-time support
- To make retargetable highly optimizing native-code compilers for various
The first target for the XDS native compiler was the Intel 80x86 processors
architecture. Besides the compiler itself, the XDS libraries and runtime support
were ported to Windows-95. The first pre-release was released in the fall of
- generation of high quality native code,
- compiler retargetability,
- machine independent optimizations.
The current version of native XDS V2.10 performs the following optimizations:
Since the first release, the XDS translator was improved. V2.11 now features:
- procedure in-lining
- common subexpression elimination
- strength reduction in loops
- code motion (moves invariant code out of loop)
- redundant code elimination
- redundant checks elimination
- powerful register allocation algorithm
The following products and improvements are in development:
- C++ generation implemented
- Improved make script generator flexibility; new version allows to use
redirection technique of XDS in makefiles for files of arbitrary types
(".asm", ".res", ".lib", ".exe" etc.)
- Conditional statements in project and template files. This allows to
maintain several modes of project generation (debug/release etc.) in
single project file
Future XDS development plans:
- Native XDS for OS/2
- Native XDS for Linux
- Integrated development environments with GUI for OS/2 and Windows
- Long filename support for native code XDS
- H2D utility - the convertor of C header filed to Modula-2 definition
- Modula-2 definitions for OS/2 interface
- Modula-2 definitions for Win32 interface
- COFF support in native XDS for Windows 95/Windows NT
- Pipeline optimizations in native XDS
- Native code compiler for PowerPC processor. The first supposed target of
this project is native XDS for PPC edition of Windows NT
Note: System-dependent modules are implemented for OS/2 only.
- Extension of the package by new portable components
(GUI application framework).
- Implementation of native code compilers for other popular processors.
IMPRESSUM: The ModulaTor is an unrefereed journal. Technical papers are to be
taken as working papers and personal rather than organizational statements.
Items are printed at the discretion of the Editor based upon his judgement on
the interest and relevancy to the readership. Letters, announcements, and
other items of professional interest are selected on the same basis.
Office of publication.
The Editor of The ModulaTor is Günter Dotzel; he can be reached at
mailto:[email deleted due to spam]
Webdesign by www.otolo.com/webworx,