Definition module 2026-11-05
A definition module declares the exported interface of a Modula-2 module. It tells clients which names and data types they can use, while the implementation module supplies procedure bodies and private details. The boundary supports separate compilation and programming abstraction.
For example, a stack interface can declare an abstract stack type and push/pop operations without exposing whether storage uses an array or a linked list. Clients should preserve the declared contract rather than inspecting hidden representation. GNU Modula-2 conventionally stores a definition module in a
.def file and parses it when compiling importing modules; it does not compile the definition module separately as executable code.[ref]Compiler options in the GNU Modula-2 documentation. §2.2, .def and .mod source-file handling
Implementation module 2026-11-05
An implementation module supplies the executable procedures and private declarations behind a Modula-2 module interface. Its associated definition module determines which declarations clients may import. This separation lets clients depend on an interface while the implementation selects a representation.
For example, a counter module can export a procedure
Next while storing a private running count. Its implementation module defines how Next updates and returns that count; clients need not know the private variable's name. Replacing the storage mechanism is possible when the exported behavior remains compatible. The GNU Modula-2 manual illustrates separate definition and implementation source files, then compiles implementation modules before linking them into a software library.[ref]Building a shared library in the GNU Modula-2 documentation. §2.14, a.def/a.mod and compilation/linking example
Modula-2 2026-11-05
Modula-2 is a systems programming language designed by Niklaus Wirth, combining structured programming with explicit software modules and facilities for low-level system construction. A definition module declares an exported interface; an implementation module supplies its implementation and private details. Clients import the declared names instead of depending on every declaration in the implementation.
For example, a stack module can export a stack type and push/pop procedures while keeping the array or linked representation private. This permits separate compilation against an interface and replacement of the implementation when its contract is preserved. Wirth's project account places Modula-2 in the Lilith workstation effort and records completion of its first compiler at ETH in1979.[ref]
Summary of projects 1962-1999 by Niklaus Wirth. Modula-2 and Lilith sections
Low-level facilities make hardware-oriented programs expressible, but also require care about the assumptions connecting language operations to devices and machine representations. Niklaus Wirth 2026-11-05
Niklaus Wirth designed Pascal, Modula-2 and Oberon, connecting language design with compiler and system construction. His project account traces their development through implementations, teaching and workstation systems rather than presenting syntax in isolation.[ref]
Summary of projects 1962-1999 by Niklaus Wirth. Pascal, Modula-2 and Oberon sections
Oberon illustrates his preference for a small explicit language definition. Its report describes type extension of records, allowing a new record type to build on an existing one. A base-typed pointer can refer to an extended record, while access to extension-specific fields requires an appropriate type test or guard. The language's value and VAR parameters also specify whether a call receives a value or access to the caller's variable.[ref]
Oberon (programming language) Created 2026-10-31 Updated 2026-11-05
Oberon is a programming language designed by Niklaus Wirth, evolving from Modula-2 with a deliberately small collection of constructs. Its modules organize declarations and imports; record type extension relates new record types to existing ones. An extending record retains its base fields and can add more, supporting controlled specialization. The language and the Oberon operating-system project are distinct objects. Different revisions have different rules, so the cited language report matters when discussing exact syntax or type compatibility.[ref]
https://people.inf.ethz.ch/wirth/Oberon/Oberon07.Report.pdf. Wirth, The Programming Language Oberon, introduction and §§6,11