Fact-checked by Grok 2 weeks ago

Modula-3

Modula-3 is a general-purpose, language developed in the late as a successor to , designed to support safe, efficient, and modular development of large-scale software systems. It was created by a team including Luca Cardelli, Jim Donahue, Lucille Glassman, Mick Jordan, Bill Kalsow, and Greg Nelson at Digital Equipment Corporation's Systems Research Center () in , in collaboration with the Research Laboratory in Cambridge, England. The initial design began in late 1986, with the first report published in August 1988 ( Report 31), followed by a revised version in November 1989 ( Report 52), and final publication in book form in 1991. The primary design goals of Modula-3 were to achieve simplicity and safety while retaining the power of a systems programming language, enabling the construction of robust, long-lived applications suitable for diverse environments including multiprocessors. It builds directly on Modula-2+ by incorporating proven features from Modula-2 and extending them with modern abstractions, while deliberately omitting problematic elements such as variant records and unsigned numeric types to reduce complexity—the entire language definition spans just 56 pages. This focus on a "complexity budget" ensured the language remained comprehensible and maintainable, prioritizing strong typing, uniform subtyping, and the isolation of unsafe code to prevent common errors in large programs. Key features of Modula-3 include modules and interfaces for structuring code and enforcing abstraction, with support for and polymorphism, generics for reusable parameterized code, for robust error management, threads and synchronization primitives for concurrency, and automatic garbage collection to simplify . Its is strongly typed with no implicit conversions, providing a safe foundation through branded types, revealed types, and opaque types that allow controlled extension and hide implementation details. Although influential in academic and research contexts—such as influencing later languages like and influencing systems like the SRC's Trestle toolkit—Modula-3 saw limited commercial adoption after the decline of its primary backers in the . Open-source implementations continue to be maintained by the community as of 2025.

History

Development Origins

Modula-3 emerged as a successor to and its extension Modula-2+, seeking to overcome limitations in modularity and runtime safety that had arisen in contexts. The project was initiated following a proposal by in November 1986 to revise and standardize Modula-2+ as a more robust language for practical use. Although , the creator of , declined involvement due to his concurrent work on , the effort gained momentum through collaboration between Digital Equipment Corporation's Systems Research Center (DEC SRC) in Palo Alto and the Research Laboratory in Menlo Park, with formal design work commencing in April 1987. Core designers included Luca Cardelli, Jim Donahue, Mick Jordan, Bill Kalsow, and Greg Nelson. The language drew significant influences from earlier systems-oriented languages like Mesa, , and , which prioritized safe programming practices without sacrificing performance. These predecessors informed Modula-3's emphasis on modular decomposition and error prevention, building on experiences from projects like Xerox PARC's system and the family. Unlike Modula-2's reliance on unchecked pointers, which could lead to unpredictable errors, Modula-3 adopted automatic garbage collection to ensure . At its foundation, Modula-3 pursued a balance of simplicity, safety, and modularity while preserving the low-level control essential for , such as device drivers and concurrent applications. The design rejected unsafe features like unchecked pointers in favor of checked exceptions and safe modes, aiming to minimize errors in large-scale software. This philosophy was encapsulated in the initial 56-page language definition, reflecting a commitment to concise, proven constructs over expansive complexity. Early prototypes and formalization were documented in the seminal Modula-3 Report (Digital SRC Research Report 31), published jointly by DEC and in August 1988, which outlined the language's syntax, semantics, and rationale. Implementation prototypes followed shortly thereafter at both institutions, validating the design's feasibility for real-world systems. The report was revised in November 1989 to incorporate refinements from these efforts.

Key Milestones and Decline

The formal definition of Modula-3 was established in 1988 through SRC Research Report 31, authored by the Systems Research Center (SRC) team including Luca Cardelli, Jim Donahue, Lucille Glassman, Mick Jordan, Bill Kalsow, and Greg Nelson. This initial specification was revised in SRC Research Report 52 in November 1989, incorporating refinements based on early implementation feedback from Digital Equipment Corporation (DEC) and Olivetti. The revised report served as the basis for the language's publication in the book Systems Programming with Modula-3 in 1991, solidifying its design principles of safety, modularity, and support for large-scale software development. The first public release of a Modula-3 implementation occurred in October 1989, developed jointly by DEC's and Olivetti's research teams, marking the transition from specification to practical use. Initial efforts toward ISO standardization, inspired by a 1980s suggestion from to to revise and standardize + as Modula-3, were ultimately abandoned, with no formal ISO standard ever produced for the language. Modula-3 reached its peak activity in the early , driven by active development at DEC and , where tools like the Trestle window system and runtime libraries were integrated into releases such as SRC Modula-3 version 2.0 in 1992. By 1996, the DEC SRC implementation achieved maturity with release 3.6, supporting multiple platforms and fostering projects, including early prototypes. During this period, the language saw adoption in academic and internal corporate environments for building reliable systems software, exemplified by its use in DEC's prototypes. The decline of Modula-3 began with corporate restructuring, particularly DEC's acquisition by in 1998, which led to the closure of and the end of official DEC support for the language. This shift aligned with broader industry trends favoring for its platform independence and C++ for performance-critical applications, reducing demand for Modula-3's specialized features like safe . In 2000, Modula-3 (CM3), a major commercial implementation, saw its parent company cease operations, further limiting professional tools. Post-2000, brief resurgence attempts emerged in the open-source community, with CM3 released as in 2000 and maintained on platforms like through the , including a 2021 release supporting modern bootstrapping via C++. Community-driven efforts, coordinated via the Modula-3 Resource Page, focused on porting to new architectures and preserving legacy code, but by 2025, these remained niche with no significant industrial adoption or widespread revival.

Syntax

Lexical and Basic Constructs

Modula-3's lexical structure defines the basic tokens that form the language's programs, including identifiers, keywords, literals, and operators, while ignoring whitespace and comments. Keywords are reserved words written in uppercase, such as MODULE, INTERFACE, BEGIN, END, IF, WHILE, TYPE, VAR, and CONST, totaling 54 in the language; they cannot be used as identifiers. Identifiers are case-sensitive names for variables, types, and procedures, starting with a letter followed by letters, digits, or underscores (e.g., myVar or Counter_1). Literals represent constant values: numeric literals support decimal, hexadecimal (prefixed with 16_), and floating-point formats (e.g., 42, 16_FF, 3.14E-2); character literals are enclosed in single quotes (e.g., 'A', '\n'); text literals use double quotes (e.g., "Hello"). Operators include arithmetic (+, -, *, /), relational (=, <, >, <=), and logical (AND, OR, NOT), with 28 defined symbols that bind according to precedence rules. Comments are nestable and delimited by (* and *), allowing multi-line annotations without affecting tokenization. Basic constructs in Modula-3 build upon these tokens to form declarations, expressions, and control structures. Declarations define names and their types: constant declarations use CONST name [: type] = expression; (e.g., CONST Pi = 3.14159;); variable declarations use VAR name: type := expression; (e.g., VAR count: INTEGER := 0;); and type declarations use TYPE name = type; for aliases or new types. Expressions combine operators and operands for computation, including arithmetic (e.g., 2 + 3 * 4), boolean (e.g., x > 0 AND y = TRUE), and calls to built-in functions like ABS or ORD. Control structures provide flow control: conditional statements use IF expression THEN statements [ELSIF expression THEN statements] [ELSE statements] END; (e.g., IF x > 0 THEN RETURN 1 ELSE RETURN -1 END;); loops include WHILE expression DO statements END; for condition-based iteration and FOR variable := low TO high [BY step] DO statements END; for ranged iteration (e.g., FOR i := 1 TO 10 DO ... END;). Type declarations specify data structures using built-in and composite types. Basic types include ordinal types like INTEGER (implementation-defined, at least 32-bit signed), [BOOLEAN](/page/Boolean) (TRUE/FALSE), [CHAR](/page/Char) (8-bit characters), and REAL (floating-point); these form the foundation without subtypes unless branded. Arrays are declared as ARRAY [index-type {, index-type}] OF element-type, supporting fixed dimensions (e.g., ARRAY [1..10] OF INTEGER) or open-ended (ARRAY OF INTEGER); initialization uses constructors like ARRAY [1..3] OF REAL {1.0, 2.0, 3.0}. Records group fields as TYPE name = RECORD field1: type; field2: type; END;, allowing named access (e.g., TYPE Point = RECORD x, y: REAL; END;) and initialization via Point {x := 1.0, y := 2.0}. A simple "Hello, World!" program demonstrates these elements in a minimal module:
MODULE Main;
IMPORT IO;
BEGIN
  IO.Put("Hello, World!\n")
END Main.
This imports the IO interface for output, uses a text literal in the Put procedure call, and structures the code within BEGIN and END blocks.

Modules and Interfaces

Modula-3 organizes code into modules and interfaces to support encapsulation, information hiding, and separate compilation. An interface defines the public specification of a module, consisting of declarations for types, constants, variables, and procedure signatures without providing implementations. This abstraction allows clients to use the interface without knowledge of internal details, promoting modularity by hiding implementation choices. Interfaces are the primary mechanism for exporting entities from modules, enabling type-safe interactions across different parts of a program. A provides the concrete implementation of one or more . Syntactically, a begins with MODULE followed by its identifier and an optional EXPORTS clause listing the it implements, then includes imports, a of declarations and statements, and ends with the identifier. The contains the bodies and any private declarations not visible outside the . to make their functionality available, while imports bring in external for use within the . This separation ensures that changes to a 's internal representation do not affect clients, as long as the remains unchanged. Both modules and interfaces serve as compilation units, allowing independent compilation and linking. When a module imports an interface, the compiler performs type-checking against the interface's declarations, ensuring consistency without needing the full module code at compile time. This facilitates large-scale development by decoupling specification from implementation. Opaque types, declared in interfaces as subtypes of REFANY or other reference types, further enhance abstraction by concealing the underlying representation; clients can only manipulate instances through exported procedures, preventing direct access to fields. For example, consider a simple abstraction. The interface might be defined as follows:
INTERFACE Stack;
  TYPE T <: REFANY;
  PROCEDURE Push(VAR s: T; x: REAL);
  PROCEDURE Pop(VAR s: T): REAL;
  PROCEDURE IsEmpty(s: T): BOOLEAN;
END Stack.
Here, T is an opaque type, visible to clients only as a reference to an unknown structure. A corresponding module implements this interface:
MODULE Stack EXPORTS Stack;
  REVEAL T = BRANDED REF RECORD
    value: REAL;
    next: T;
  END;
  PROCEDURE Push(VAR s: T; x: REAL) =
    BEGIN
      s := NEW(T, value := x, next := s);
    END Push;
  PROCEDURE Pop(VAR s: T): REAL =
    VAR res: REAL;
    BEGIN
      res := s.value;
      s := s.next;
      RETURN res;
    END Pop;
  PROCEDURE IsEmpty(s: T): BOOLEAN =
    BEGIN
      RETURN s = NIL;
    END IsEmpty;
BEGIN
END Stack.
Clients can import and use the Stack interface to create and manipulate stacks without knowing the linked-list representation revealed only in the module. This example illustrates how interfaces enable type-safe, encapsulated usage across compilation units.

Language Features

Modularity

Modula-3's modularity is centered on a design philosophy that promotes structured programming for large-scale systems through separate compilation units and precise namespace management, building directly on the module system introduced in while enhancing safety and abstraction. The core mechanisms are interfaces, which declare public types, procedures, and constants, and modules, which provide their implementations. This separation enables type-safe separate compilation, where changes to a module's implementation do not require recompiling dependent code as long as the interface remains unchanged. Interfaces make it possible to reason about large systems without needing to consider the entire codebase simultaneously, fostering abstraction and reducing cognitive load during development. The language supports hierarchical organization through nested scopes within modules, allowing developers to structure code in a modular, layered fashion that mirrors the complexity of real-world systems. Export sets are defined via the EXPORTS clause in a module declaration, which lists the interfaces the module implements and makes publicly available, thereby controlling what is visible to other parts of the program. Controlled visibility is further refined through import clauses: the FROM clause permits selective importation of specific names from an interface (e.g., FROM I IMPORT N1, N2), limiting namespace pollution and enabling fine-grained access. These features ensure that namespaces are managed explicitly, preventing unintended interactions between components. Compared to Modula-2's DEFINITION modules, which similarly separated specifications from implementations but included unsafe features like variant records that could lead to runtime errors, Modula-3 improves safety by eliminating such constructs and confining low-level operations to explicitly marked UNSAFE modules. This design reduces the risk of type violations and pointer errors in modular code, making it more reliable for systems programming. The benefits include reduced coupling between components, as implementations are hidden behind interfaces; easier maintenance, since modifications are localized; and better support for large systems, where modularity scales to thousands of modules without monolithic recompilations. In systems programming, Modula-3's modularity plays a key role by allowing safe extensions to existing codebases without requiring recompilation of unaffected parts, thanks to the stable contract provided by interfaces and the type-checking enforced during separate compilation. This facilitates incremental development of operating systems and distributed applications, where new modules can implement standard interfaces to integrate seamlessly while preserving overall system integrity.

Safe and Unsafe Modes

Modula-3 employs a dual-mode design to balance type safety and performance, distinguishing between safe and unsafe code to mitigate common programming errors while supporting low-level systems programming. In safe mode, the language enforces strict guarantees against unchecked runtime errors, such as buffer overflows or invalid memory access, by prohibiting features that could corrupt the runtime system. This mode relies on traced references for pointers, which are automatically managed by the garbage collector to prevent dangling pointers, and includes runtime bounds checking for array accesses to ensure indices remain within defined limits. Conversely, unsafe mode, explicitly declared using the UNSAFE keyword for modules or interfaces, relaxes these restrictions to enable direct hardware interaction and optimization in performance-critical contexts like operating system kernels or device drivers. Unsafe code permits untraced references (e.g., UNTRACED REF T or the ADDRESS type), which bypass garbage collection and allow manual memory management via operations like DISPOSE, as well as unchecked pointer arithmetic and type reinterpretation through LOOPHOLE or ADR. The programmer bears full responsibility for avoiding errors in unsafe sections, as the compiler does not insert protective checks. The rationale for this separation stems from the need to isolate potentially dangerous operations, allowing safe modules to share address spaces without risk of corruption from low-level code, while still accommodating the demands of systems programming where runtime overhead from checks would be prohibitive. Safe modules cannot import or export unsafe interfaces, ensuring a clear boundary, but unsafe modules may implement safe interfaces, enabling controlled exposure of low-level functionality to higher-level code. During compilation, projects can mix safe and unsafe components, with the compiler enforcing these rules statically; runtime checks, such as array bounds or type compatibility for references, apply only within safe contexts. Memory allocation in safe mode uses traced references exclusively, integrating seamlessly with automatic garbage collection. For illustration, consider array access: in safe mode, an operation like a[i] triggers a runtime check to verify i is within bounds, raising an exception if violated, as in the following example:
modula3
VAR a: ARRAY [1..10] OF INTEGER;
BEGIN
  a[0] := 42;  (* Runtime bounds check fails, aborts safely *)
END;
In unsafe mode, such checks are omitted for efficiency, permitting direct pointer manipulation, such as:
modula3
UNSAFE MODULE UnsafeExample;
IMPORT Word;
VAR p: ADDRESS := ADR(a[0]);
BEGIN
  Word.Put(p, 0, 42);  (* No bounds check; assumes programmer correctness *)
END UnsafeExample;
This approach promotes secure application development while preserving flexibility for foundational software.

Generics

Modula-3 supports generic programming through parameterized interfaces and modules, allowing developers to write reusable code that operates on different types without duplicating functionality. A generic interface or module is declared using the GENERIC keyword followed by the formal parameters, which are typically interface identifiers representing types or other abstractions. For example, the syntax for a generic interface is GENERIC INTERFACE Name(Formal1, ..., FormalN); Body END Name., where the formals are bound to actual interfaces during instantiation. Similarly, generic modules follow the form GENERIC MODULE Name(Formal1, ..., FormalN); Body END Name., enabling the implementation of type-parameterized abstractions. Instantiation of a generic occurs at compile-time by providing actual parameters that match the formals, resulting in monomorphized code specific to those types. For an interface, this is expressed as INTERFACE Instance = GenericName(Actual1, ..., ActualN) END Instance., which expands the generic body by importing the actuals as the formals. Module instantiation uses MODULE Instance EXPORTS Exports = GenericName(Actual1, ..., ActualN) END Instance., producing a concrete module with statically resolved types. This process ensures all type checking and code generation happen statically, with each instantiation compiled independently without shared code between different type parameters. Modula-3's generics are limited to static resolution, with no support for runtime parameterization or dynamic dispatch on types, emphasizing compile-time safety and efficiency. Formal parameters must be complete interfaces rather than partial type specifications, and generics are confined to the module level without isolated generic procedures or types. These constraints prevent runtime overhead but require explicit instantiation for each use case. Common use cases for Modula-3 generics include implementing reusable data structures such as lists, stacks, and tables that can handle arbitrary element types. For instance, a generic stack interface might be defined as follows:
GENERIC INTERFACE Stack(Elem);
  TYPE T <: REFANY;
  PROCEDURE Create(): T;
  PROCEDURE Push(s: T; e: Elem.T);
  PROCEDURE Pop(s: T): Elem.T;
END Stack.
An implementing module would then provide the stack operations using the Elem parameter. This can be instantiated for specific types, such as integers via INTERFACE IntStack = Stack(Integer) END IntStack. or for arbitrary references via INTERFACE AnyStack = Stack(REFANY) END AnyStack., generating type-safe, monomorphized code for each.

Object-Oriented Programming

Modula-3 integrates object-oriented programming principles through its support for objects, which are implemented as references to branded records containing data fields and associated methods. These objects enable encapsulation of state and behavior, with methods defined as procedures that take the object as their first implicit argument. The language's type system ensures type safety by branding object types, preventing unintended aliasing or confusion between distinct types. Subtyping and inheritance in Modula-3 are achieved using OBJECT types, which support single inheritance to promote code reuse and hierarchical organization. A subtype extends a supertype by adding fields or overriding methods, forming an inheritance chain where subtypes are compatible with their supertypes. For instance, an object type AB can inherit from A via the declaration TYPE AB = A OBJECT b: BOOLEAN END;, allowing instances of AB to be used wherever A is expected. This single-inheritance model avoids the complexities of multiple inheritance while maintaining extensibility. BRANDED types further refine this by attaching unique identifiers to types, enhancing safety in generic and polymorphic contexts. Polymorphism is facilitated through the REFANY type, which represents any traced reference and serves as a supertype for all object references, enabling heterogeneous collections. Runtime type checking and conversion are handled by the NARROW and WIDE operators: NARROW verifies if a reference matches a specific subtype and raises an exception if not, while WIDE performs safe upcasting to a supertype. These mechanisms allow dynamic dispatch of methods without sacrificing compile-time checks where possible. To simulate aspects of multiple inheritance, Modula-3 employs interfaces, which define abstract method signatures that concrete object types can implement. An interface specifies required methods without implementation details, allowing an object to conform to multiple interfaces independently of its inheritance hierarchy. This approach supports flexible composition of behaviors, such as an object implementing both a Drawable and a Resizable interface. A representative example of a class hierarchy is a shape system where a base Shape object type defines a draw method, extended by subtypes like Circle. The interface might be declared as:
INTERFACE Drawable;
  PROCEDURE draw(self: REFANY);
END Drawable.
The base object type could then be:
TYPE Shape = OBJECT
  x, y: REAL;
  METHODS draw() : Drawable;
END;
A subtype Circle inherits and adds specific fields:
TYPE Circle = Shape OBJECT
  radius: REAL;
END;
Instances can be stored in a REFANY array and dispatched polymorphically using NARROW to call draw on each, rendering the appropriate shape behavior.

Revelation

In Modula-3, opaque types provide a mechanism for abstracting data structures by hiding their concrete implementations in interfaces while allowing controlled exposure through revelations in modules. An opaque type is declared in an interface as a subtype of a reference type, such as TYPE T <: REFANY, where the exact representation remains unknown to clients importing the interface. This design supports modular programming by enforcing abstraction boundaries, preventing direct manipulation of internal details. The REVEAL statement is used within a module to expose the concrete type corresponding to an opaque type declared in an interface it implements. There are two forms: a partial revelation, REVEAL T <: V, which discloses that the opaque type T is a subtype of some type V (e.g., REVEAL T <: ROOT), and a complete revelation, REVEAL T = V, which fully specifies the concrete type V (e.g., REVEAL T = REFARRAY OF INTEGER). A program must contain exactly one complete revelation per opaque type, and any partial revelations must be consistent with it, forming a linear chain of supertypes. Revelations can occur in interfaces or at the outermost scope of modules, and imported revelations propagate to dependent scopes. Type compatibility across revelations is ensured through Modula-3's branded type system, where each opaque type is implicitly branded to distinguish it uniquely from others, even if their concrete types appear structurally identical. This prevents accidental aliasing and guarantees that revelations for the same opaque type align precisely, while distinct opaque types remain incompatible regardless of shared structure. The system traces revelations hierarchically: if a revelation points to another opaque type, it resolves recursively to the ultimate concrete type, maintaining global consistency without runtime checks. The revelation mechanism benefits modular code by preserving abstraction in public interfaces—clients see only necessary supertypes—while enabling optimizations and extensions in private implementations. For instance, a compiler can optimize operations on revealed concrete types (e.g., inlining array accesses) without exposing those details to clients, and extensions can add fields or methods in subclasses without breaking existing code. This approach facilitates safe evolution of libraries, as revelations allow incremental disclosure without recompiling dependents. A representative example involves an opaque list type in an interface List declared as TYPE Node <: REFANY, with procedures for insertion and traversal. In the implementing module, a complete revelation might expose it as a linked structure:
REVEAL Node = BRANDED OBJECT
  value: INTEGER;
  next: Node;
END;
This reveals Node as a branded object with fields for value and linkage, allowing efficient pointer-based operations internally while clients interact only via the opaque abstraction. Alternatively, for contiguous storage, it could be revealed as REVEAL Node = REFARRAY OF POINTER, optimizing for array traversals without altering the interface.

Exceptions

Modula-3 provides a structured exception handling mechanism to manage errors gracefully, allowing programs to detect and respond to exceptional conditions without abrupt termination. Exceptions are declared in interfaces or at the top level of modules using the syntax EXCEPTION <name> [(<type>)], where the optional <type> specifies an argument passed with the exception. This design supports both parameterless exceptions for simple signaling and parameterized ones for conveying additional context, such as error codes or values. Built-in exceptions include the generic Error exception, often used in standard interfaces to report runtime issues like arithmetic overflows. Exceptions are raised using the RAISE statement: RAISE <exception> [(<argument>)], which signals the specified exception and, if applicable, supplies the argument. When raised, the exception propagates outward, unwinding the call stack until it encounters a matching handler or reaches the program's top level, at which point the computation terminates in an implementation-defined manner. This stack unwinding ensures that resources allocated in intermediate frames can be cleaned up via handlers, promoting reliable error recovery. Handling occurs primarily through the TRY-EXCEPT statement, which guards a block of code and specifies responses for specific exceptions:
TRY
  <guarded statements>
EXCEPT
| <exception1> [(<var1>)] => <handler1>
| <exception2> [(<var2>)] => <handler2>
  ...
[ ELSE <default handler> ]
END
If an exception matches a listed identifier, the corresponding handler executes, binding the argument to <var> if provided; otherwise, the ELSE clause (if present) handles unmatched cases. Execution then resumes after the END. For cleanup regardless of exceptions, the TRY-FINALLY statement ensures a final block runs:
TRY
  <guarded statements>
FINALLY
  <cleanup statements>
END
The cleanup executes even if an exception occurs, after which the exception is re-raised for further propagation. This combination allows precise control over during error flows. Modula-3's exception system integrates with its safe/unsafe mode distinction to enhance reliability. In safe modules—those not marked UNSAFE—the guarantees the absence of unchecked runtime errors, such as array bounds violations or null dereferences, by enforcing static checks; violations trigger checked runtime errors reported via exceptions. Unchecked errors, possible only in unsafe code, may lead to arbitrary behavior if undetected, but exceptions remain the primary mechanism for signaling checked conditions like unhandled raises. This design avoids unchecked errors in safe code while leveraging exceptions for robust error management. A representative example is handling potential in arithmetic, which constitutes a checked in . A custom exception can be declared and raised explicitly:
INTERFACE DivExample;
  EXCEPTION ZeroDivide;
END DivExample.

MODULE DivExampleImpl;
  IMPORT DivExample;
  PROCEDURE SafeDivide(numerator, denominator: [INTEGER](/page/Integer)): [INTEGER](/page/Integer) =
  BEGIN
    IF denominator = 0 THEN RAISE DivExample.ZeroDivide END;
    RETURN numerator DIV denominator
  END SafeDivide;
END DivExampleImpl.
To catch this:
TRY
  result := DivExampleImpl.SafeDivide(10, 0);
EXCEPT
| DivExample.ZeroDivide => (* Handle [error](/page/Error), e.g., return -1 or [log](/page/Log) *)
    result := -1;
END
This approach allows programmers to intercept and recover from arithmetic errors predictably. Thread-related exceptions, such as those from inter-thread communication failures, can also propagate but are handled similarly within concurrency contexts.

Concurrency

Modula-3 incorporates concurrency as a core language feature, supporting threads and mechanisms to enable safe multi-threaded programming. s represent independent units of execution that can run concurrently, even on multiprocessor systems, extending the model from to full threads of control. The primary abstraction for creating threads is the Thread.Fork procedure, which takes a —an object with an [apply](/page/Apply) —and spawns a new thread to execute it, returning a thread handle of type T. To synchronize thread completion, Thread.Join waits for the specified to terminate and returns any result value produced by its execution. Synchronization in Modula-3 draws from Hoare's monitor model, extended by Mesa's practical refinements, to protect shared data from concurrent access. Monitors are implemented using mutex locks (Mutex type) and condition variables (Condition type), ensuring mutual exclusion and coordination among threads. The Acquire procedure locks a mutex, blocking if it is already held, while Release unlocks it; these are paired with condition operations like Wait, which atomically releases the mutex and suspends the thread until signaled, then reacquires the lock upon resumption. Signaling occurs via Signal, which wakes one waiting thread (or more, depending on implementation), or Broadcast, which wakes all waiters on a condition. A dedicated LOCK statement simplifies critical sections: LOCK mu DO S END acquires the mutex mu, executes statement S, and releases it, equivalent to explicit Acquire/Release wrapped in a try-finally block. Modula-3 supports operations through its , guaranteeing that critical sections bounded by locks execute indivisibly with respect to other . The AtomicSize constant defines the of for atomic accesses, typically aligning with hardware word size. Barriers, for coordinating groups of to synchronize at a common point, can be constructed using condition variables and a shared protected by a mutex, though no primitive barrier type is built into the core . In , Modula-3 enforces restrictions on unsafe operations like unchecked pointer arithmetic, but concurrency primitives remain available; programmers must use locks to protect shared mutable state, preventing data races without relying on unsafe low-level mechanisms. This integration promotes by design, as safe code cannot bypass for mutable references. A classic example is a producer-consumer pattern implemented with a encapsulating a bounded . The monitor uses a mutex to serialize access and two variables—one for empty queue (waited by consumers) and one for full (waited by producers):
TYPE Monitor = OBJECT
  q: Queue;
  mu: Mutex;
  notFull, notEmpty: Condition;
METHODS
  insert(item: Item) =
    LOCK mu DO
      WHILE full(q) DO Await(mu, notFull) END;
      add(q, item);
      Signal(notEmpty)
    END;
  remove(): Item =
    LOCK mu DO
      WHILE empty(q) DO Await(mu, notEmpty) END;
      VAR res := take(q); Signal(notFull); RETURN res
    END
END;
Here, producers call insert, blocking on notFull if the queue is full, while consumers call remove, blocking on notEmpty if empty; signals resume waiting threads after queue operations. This structure ensures bounded buffer safety without busy-waiting.

Memory Management

Modula-3 provides dynamic memory allocation through the built-in NEW procedure, which allocates objects on the and returns a traced to them. Traced references are of type REF T, where T is the type of the object being allocated; these references are automatically managed by the collector to prevent memory leaks and dangling pointers. In , which is the default for most programs, all heap allocations use traced references, ensuring that the cannot be corrupted by invalid memory access. The language employs automatic garbage collection for reclaiming unused storage, eliminating the need for explicit deallocation such as a [free](/page/Free) procedure. This mechanism supports robust, long-lived systems by automatically detecting and freeing unreachable objects, thereby avoiding common errors like storage leaks. In the safe mode, the type system and enforce that only valid references are used, further preventing issues like dangling pointers. Implementations of Modula-3, such as the and compilers, feature a generational garbage collector that is automatic and incremental by default, dividing objects into generations based on allocation age to optimize collection efficiency. This approach minimizes pauses during collection, with short interruptions and improved overall performance compared to non-generational collectors. Weak references, provided via the WeakRef interface in implementations like Modula-3, allow referencing objects without preventing their collection if no strong references remain, useful for caches and detecting unreachability. Customization of garbage collection is supported through runtime parameters and optional features. For instance, collectors can be configured for incremental operation or background threading, though the latter is not enabled by default in some implementations. While core Modula-3 does not include built-in finalization for objects, extensions and proposals have explored adding finalizers to perform cleanup actions upon collection, similar to in other languages. Untraced references, available in unsafe modules, bypass garbage collection for performance-critical code but require manual management. A representative example of dynamic allocation is creating a resizable array of elements, as shown in a generic stack implementation:
GENERIC MODULE Stack(Elem);
IMPORT RefSeq;
REVEAL T = Public BRANDED RefSeq.T OBJECT OVERRIDES ... END;
...
PROCEDURE Push(VAR s: T; READONLY e: Elem.T) =
  BEGIN
    IF s = NIL THEN s := New() END;
    IF s.size() = s.sizeLimit() THEN
      VAR temp := NEW(REF ARRAY OF Elem.T, 2 * s.size()); (* Double capacity *)
      ...
    END;
    ...
  END Push;
This code uses NEW to allocate a heap array via a REF ARRAY OF Elem.T when expanding the stack, demonstrating how dynamic arrays are handled without manual deallocation.

Standard Library

Core Modules

The core modules of Modula-3's provide foundational abstractions for data handling and basic computations, enabling programmers to perform essential operations without relying on lower-level code. These modules are defined as interfaces in the language specification, offering type-safe procedures for common tasks while integrating seamlessly with the language's module system. The Text interface handles string manipulation and formatting, representing non-nil values of type TEXT as immutable, zero-based sequences of zero or more values, where CHAR is an ordinal type corresponding to ISO-Latin-1 characters. It includes procedures for converting between TEXT and ARRAY OF CHAR, comparing strings for or , extracting , and concatenating texts, such as Text.Sub(t: TEXT; start, length: CARDINAL): TEXT for substring extraction. These operations ensure efficient, safe handling of strings without . The Word interface supports bitwise operations on unsigned machine words, where a value of type Word.T represents a fixed-size sequence of bits determined by the platform's word size (typically 32 or 64 bits). Key procedures include logical operations like Word.And(x, y: T): T for bitwise AND, Word.Or(x, y: T): T for bitwise OR, Word.Xor(x, y: T): T for , and shifts such as Word.Shift(x: T; n: [INTEGER](/page/Integer)): T, along with extraction functions like Word.Extract(x: T; n, w: [CARDINAL](/page/Cardinal)): T to isolate bit fields. These enable low-level integer manipulation while maintaining . The Math interface offers basic arithmetic and transcendental functions for floating-point types including REAL, LONGREAL, and EXTENDED, wrapping standard mathematical computations from underlying libraries. It provides procedures for operations like sine (Math.sin(x: REAL): REAL), cosine (Math.cos(x: REAL): REAL), square root (Math.sqrt(x: REAL): REAL), exponentiation (Math.exp(x: REAL): REAL), and logarithms (Math.log(x: REAL): REAL), supporting numerical computations essential for scientific and applications. Constants such as Math.pi and Math.e are also defined for precision. The interface generates unique identifiers as atomic references, where an Atom.T serves as a canonical representative for equal texts, akin to symbols in , ensuring efficient interning for repeated strings. The primary procedure Atom.FromText(t: TEXT): T creates or retrieves an existing atom for a given text, with equality checks via comparison; atoms are garbage-collected and subtype REFANY for polymorphism. This is particularly useful for symbol tables or keys in data structures. Some core modules underwent in the original implementation to ensure absence of bugs like race conditions or overflows, contributing to Modula-3's reputation for reliability. These modules are imported into programs using FROM clauses for direct access to procedures without qualification, as in FROM Text IMPORT Sub, Cat;, allowing concise code while preserving ; for example, I/O routines may reference Text for output formatting.

Specialized Utilities

The specialized utilities in Modula-3's standard library extend the core abstractions with practical modules for operations, concurrency support, text formatting, and system error management, enabling robust interactions with s and threads. For I/O, the library provides FileRd and FileWr interfaces, which offer buffered, seekable for reading from and writing to s, respectively, replacing earlier concepts like FileStream. The FileRd.Open(pathname: Pathname.T): FileRd.T procedure opens a for reading and raises an OSError.E exception if the operation fails, such as due to invalid paths or permissions. Similarly, FileWr.Open(pathname: Pathname.T): FileWr.T creates or truncates a for writing, with an OpenAppend variant for appending to existing s, both also raising OSError.E on failure. The TextWr interface complements these by providing a buffered text writer subtype of Wr.T, supporting procedures like PutText(text: TEXT) to output strings and New(): TextWr.T to create a new in-memory , facilitating formatted text handling without direct access. Concurrency support is handled through the Thread module, which includes primitives such as Fork(procedure: PROCEDURE () RAISES {}): Thread.T to spawn a new thread executing the given , and Join(thread: Thread.T) to wait for its completion and retrieve any result. For synchronization, Mutex objects enable with Acquire(mutex: Mutex.T) to lock and Release(mutex: Mutex.T) to unlock, preventing race conditions in access; these build on the language's concurrency model detailed elsewhere. The Fmt module aids output formatting by converting basic types to text strings, with procedures like Int(i: INTEGER): TEXT for integers, Real(r: REAL; style: Style := Sci; prec: INTEGER := 6): TEXT for floating-point numbers in scientific, fixed, or automatic styles, and Bool(b: BOOLEAN): TEXT for booleans, ensuring consistent textual representation for or display. System interactions incorporate error handling via the OSError module, which defines the E(code: AtomList.T) exception raised by OS-dependent operations in I/O and other utilities, capturing codes for diagnosis without halting execution unless unhandled. A representative example of file reading with error checks uses FileRd and :
VAR
  rd: FileRd.T;
BEGIN
  TRY
    rd := FileRd.Open("example.txt");
    (* Read operations here, e.g., rd.getChar() *)
  FINALLY
    IF rd # NIL THEN FileRd.Close(rd) END
  END
EXCEPTION
  OSError.E (code) =>
    (* Handle error, e.g., log code *)
END;
This structure ensures resources are released even if an OSError.E is raised during opening or reading.

Implementations

Historical Compilers

The SRC Modula-3 compiler, released in December 1989 by Digital Equipment Corporation's Systems Research Center (), served as the first of Modula-3, initially targeting and Unix platforms on VAX and architectures. Developed by Bill Kalsow and Eric Muller, it was bootstrapped using Modula-2+ and originally generated C code for the compiler, later evolving to use an intermediate language for improved performance. This implementation was restricted to research and internal use, supporting the development of systems like the operating system at . Olivetti and DEC collaborated on early integrated environments for Modula-3, with Olivetti Research releasing tools in 1989 that utilized the M3AST front-end to generate C code from source. These environments emphasized seamless for building and , but halted following the shutdown of Olivetti Research in February 1991. The joint efforts between Olivetti and DEC, formalized after the language's definition in August 1988 and revised in November 1989, laid the groundwork for these tools, focusing on portability across Unix-based systems. Other notable historical implementations include GNU Modula-3, developed in the late 1980s at the , and SPIN Modula-3 from the in 1996, which extended the language for operating system extensibility on platforms. The M3/PC Klagenfurt compiler, developed in the early 1990s by Klaus Preschern and Carsten Weich at the , provided an educational version of Modula-3 adapted for DOS-based PCs, building on SRC Modula-3 version 2.09. Targeted at undergraduate programming courses, it offered a lightweight setup for personal computers, enabling hands-on learning of the language's features without requiring high-end hardware. Key features across these historical compilers included persistent configurations for and link-time optimization to enhance code efficiency during compilation. Initially limited to VAX and platforms with Unix and support, these implementations were primarily for research and educational purposes, reflecting Modula-3's origins in academic and industrial experimentation during the late 1980s and 1990s.

Modern and Community Variants

Critical Mass Modula-3 (CM3) represents the primary open-source implementation maintained since 2000 by elego Software Solutions , evolving from the commercial distribution with enhancements for portability across platforms like Unix, Windows, and macOS. The last official release, version 5.8.6, occurred in 2010, with a significant update in December 2021 introducing a new installer and source-based distribution; internal development has progressed to version 5.10.0 with ongoing slow improvements. Recent activity in 2024 includes community discussions on using CM3 for as a C++ alternative, alongside efforts to port and build on modern and Windows environments. Polytechnique Montréal Modula-3 (PM3) is a comprehensive open-source distribution derived from the SRC Modula-3 base, incorporating enhancements from Cambridge Modula-3 and over 15,000 source files for a full development environment. Maintained through contributions from researchers like Anthony Hosking, it merges elements from CM3 and supports persistence features developed at Purdue University, focusing on experimental garbage collection improvements for orthogonal persistence in long-running applications. The repository remains available for bootstrapping compilers and libraries, though no formal releases have been published recently. EzM3 serves as a lightweight, portable variant based on PM3, designed primarily for educational purposes and simple installations, such as building tools like CVSup without the full PM3 overhead. It emphasizes ease of use across platforms, stripping down to essential compiler and runtime components for quick deployment in teaching or minimal environments. Similarly, HM3 extends the PM3-1.1.15 lineage with support for native threading via NPTL, targeting educational and experimental use on systems while maintaining compatibility with core Modula-3 standards. As of 2025, Modula-3 variants like CM3 and PM3 remain compatible with modern operating systems including recent distributions and Windows, supported by ports and builds shared on , though no major new releases have emerged since the early . Discussions in developer forums highlight revival interest, with users exploring integrations for maintenance and niche , but active is limited to sporadic contributions. Key challenges include the absence of robust support for platforms or assembly targets, restricting adoption beyond and systems where Modula-3's concurrency and modules continue to provide value.

Adoption and Legacy

Notable Projects

One of the most prominent projects built with Modula-3 is the operating system, a research kernel developed at the that emphasizes extensibility and safety through application-specific customizations. leverages Modula-3's type-safe features and support for untrusted extensions to allow low-overhead integration of user code directly into the kernel, enabling efficient performance without compromising stability. This design facilitated experiments in customizable operating system services, such as optimized networking and storage, while protecting kernel data structures. CVSup, a synchronization tool for CVS repositories, was implemented in Modula-3 by John D. Polstra to provide fast, reliable updates across distributed systems. Its use of Modula-3's threading and network capabilities enabled efficient handling of large-scale repository mirroring, making it a key utility for and other open-source projects in the and early . Obliq, a lexically-scoped, object-oriented for , was created by Cardelli and relies on Modula-3's network objects for transparent remote method invocation across machines. This implementation allowed Obliq to support seamless object migration and replication in heterogeneous environments, demonstrating Modula-3's suitability for building higher-level distributed abstractions. At DEC's Systems Research Center (SRC), Modula-3 powered several influential systems, including the Trestle for object-oriented graphical interfaces, the VBTkit , and FormsVBT for declarative UI design. Other SRC efforts encompassed Network Objects for distributed object communication and , a for visualization and collaborative editing. These projects highlighted Modula-3's role in developing robust, modular tools for graphical and networked applications within DEC's ecosystem. While Modula-3 saw significant use in academic settings, such as operating systems courses and research at institutions like Aachen University of Technology, its adoption has remained niche by 2025, with most activity confined to legacy maintenance and open-source distributions like Critical Mass Modula-3.

Influences on Other Languages

Modula-3's design principles, particularly its emphasis on , modular , and the isolation of unsafe operations, have left a notable imprint on several subsequent programming languages, especially in the realm of systems and . One of the most prominent influences is on , developed in the mid-1990s. Modula-3's , which separate abstract types from their implementations, directly inspired Java's interface construct, enabling polymorphic behavior and in object-oriented designs. Similarly, Modula-3's distinction between safe (checked) and unsafe (unchecked) pointers informed Java's approach to , where the language enforces bounds checking and eliminates unchecked pointer arithmetic in safe code paths. Java's automatic garbage collection system also draws conceptual parallels from Modula-3's integrated collector, though implemented differently. A specific and direct impact is seen in Java's Remote Method Invocation (RMI) framework, which adopts a reference-counting distributed garbage collection algorithm modeled after Modula-3's Network Objects system; this mechanism tracks references across JVMs, incrementing counts on entry and decrementing on exit to enable timely reclamation of remote objects. The Network Objects design, detailed in the seminal SRC Technical Report, provided a blueprint for RMI's handling of distributed references and unreferenced notifications via the Unreferenced interface. Python's creator, , has acknowledged Modula-3 as a primary influence alongside , particularly in shaping its object-oriented features and exception model. Modula-3's class mechanisms, which support , , and modular encapsulation, contributed to Python's hybrid class system, blending single with dynamic for readable and reusable code. The exception handling in Python evolved from Modula-3's approach, where exceptions are treated as unique tokens rather than strings, avoiding name clashes and enabling hierarchical exception classes; this shift to class-based exceptions was implemented in Python 1.5, resolving early issues with string-based exceptions inherited indirectly from Modula-3's token model. Nim explicitly borrows heavily from Modula-3 in its core design, as stated in the language's official , prioritizing Modula-3 among its influences for syntax, modularity, and safety features. Nim's modular safety mechanisms, including traced and untraced references (analogous to Modula-3's safe and unsafe pointers), enforce by default while allowing opt-in low-level control, mirroring Modula-3's isolation of unsafe code to prevent runtime corruption. Generics in Nim, enhanced by type classes and module parameterization, directly extend Modula-3's generic modules, where interfaces and implementations can be parameterized for reusable abstractions without sacrificing . In the Oberon family, extensions like incorporated object-oriented features comparable to Modula-3's, such as type extension and procedural objects, fostering a shared emphasis on and safety in ; a comparative analysis highlights how both languages evolved procedural paradigms into lightweight support without classes. Rust's safe/unsafe duality echoes Modula-3's explicit marking of unsafe modules, where low-level operations like unchecked pointers are confined to designated unsafe scopes to preserve overall type and ; this isolation ensures that safe code cannot invoke unsafe behaviors inadvertently, a principle outlined in Modula-3's language specification. Overall, Modula-3's legacy endures in modern languages through its advocacy for safe , where type-safe abstractions and controlled unsafety enable reliable, concurrent software without the pitfalls of unchecked low-level access, influencing paradigms in languages like and that prioritize preventing common errors like buffer overflows and data races.

Literature

Key Books

Several key books published in the early form the core literature for learning and applying Modula-3, ranging from introductory tutorials to advanced and algorithmic implementations. These texts emphasize the language's strengths in safe, modular, and concurrent programming, providing both theoretical insights and practical examples. They were primarily developed in collaboration with the language's designers at the Digital Equipment Corporation's Systems Research Center () and Olivetti Research Laboratory. "Systems Programming with Modula-3," edited by Greg Nelson and published in 1991 by (ISBN 0-13-590464-1), stands as the definitive reference from the team. It includes the complete language definition, detailed descriptions of standard libraries, and the rationale behind Modula-3's design choices, with examples spanning tutorial-level code to complex systems applications. The book addresses advanced topics such as interfaces, exceptions, and , making it essential for developers building large-scale software. "Modula-3" by Samuel P. Harbison, released in 1992 by (ISBN 0-13-596396-6), serves as a comprehensive and manual. It guides readers through writing maintainable programs, covering object-oriented features, concurrency, generics, and unsafe code isolation, accompanied by exercises, code samples, and a dedicated style manual. Harbison's work also includes a user's guide tailored to the Modula-3 compiler, highlighting best practices for robust . For newcomers, "Programming in Modula-3: An Introduction in Programming with Style" by László Böszörményi and Carsten Weich, published in 1996 by (ISBN 3-540-57912-5), offers a beginner-friendly . The progresses from basic syntax and control structures to advanced topics like data abstraction and algorithms, using styled examples to teach programming discipline and Modula-3's modular . It emphasizes practical problem-solving, making it suitable for educational settings. "Algorithms in Modula-3" by , issued in 1993 by (ISBN 0-201-53351-0), focuses on implementing classic algorithms and data structures in the language. It covers , , graphs, and strings with efficient Modula-3 code, illustrating the language's suitability for computational tasks while providing reusable modules as pedagogical tools. This text bridges programming fundamentals with algorithmic theory for intermediate learners. As of 2025, all these titles remain with no new editions released, reflecting Modula-3's status as a historical . Used physical copies are obtainable via secondary markets like , while digital scans and previews are accessible on archives such as the and , preserving their availability for researchers and enthusiasts.

Documentation Resources

The primary formal definition of the Modula-3 programming is provided by The Modula-3 Report (revised), authored by Luca Cardelli, James Donahue, Lucille Glassman, Mick Jordan, Bill Kalsow, and Greg Nelson of the Systems Research Center () at . This document, originally issued as SRC Research Report 31 in 1988 and revised in 1989 with further updates reflected in 1992 publications, outlines the language's syntax, semantics, , modules, interfaces, and safety features in detail. Complementing the report, the Modula-3 Language Manual serves as a practical reference for syntax and usage, while the Modula-3 Interface Reference documents standard for common abstractions such as I/O, threads, and . These resources, developed by the SRC team, emphasize Modula-3's modular structure and safe programming practices, with the interface reference exemplified by SRC Research Report 113, which describes reusable components like text processing and network protocols. Historical archives preserve these foundational documents and related materials. The Software Preservation Group's Modula-3 collection, hosted by the , includes scanned PDFs of SRC reports, source code distributions, and development notes from the late and , ensuring accessibility for researchers studying the language's evolution. Similarly, the modula3.org site maintains a curated repository of original DEC and resources, including compiler binaries and example code. As of 2025, community-driven updates focus on the Modula-3 (CM3) implementation, with documentation hosted on repositories such as the official CM3 project, which includes build guides, references, and for modern platforms. Historical PDFs from the Association for Computing Machinery (ACM) , such as the language definition in SIGPLAN Notices, provide additional peer-reviewed excerpts and extensions. Notable gaps in documentation include the absence of an active, collaborative for ongoing contributions, leaving reliance on static archives. However, FAQs from the , such as those compiled in the Modula-3 FAQ on faqs.org, remain relevant for addressing common queries on language features and implementation quirks.

References

  1. [1]
    Modula-3 Historical Archive - Software Preservation Group
    This is an annotated collection of documents, source code, and other materials concerning the birth, development, and use of the Modula-3 programming language.<|control11|><|separator|>
  2. [2]
    Modula-3: Introduction - Purdue Computer Science
    Modula-3 aims at larger systems that illustrate how object types provide structure for large programs. In Modula-3 the main design effort is concentrated into ...
  3. [3]
    The Modula–3 type system - ACM Digital Library
    This paper presents an overview of the programming language Modula-3, and a more detailed description of its type system.
  4. [4]
    [PDF] The Modula-3 Type System - Luca Cardelli
    The design of the programming language Modula-3 was a joint effort by the Digital Systems Research Center and the. Olivetti Research Center, undertaken with ...Missing: origins | Show results with:origins<|control11|><|separator|>
  5. [5]
    [PDF] Modula-3 report (revised) - Bitsavers.org
    Nov 1, 1989 · The Modula-3 report was published by Olivetti and Digital in August 1988. Imple- mentation efforts followed shortly at both companies. In ...Missing: origins 1986
  6. [6]
    Modula-3 language definition
    The original definition of Modula-3 was given in SRC Research Report 31, August 1988. It was revised in report 52, November 1989. And finally published in ...
  7. [7]
    [PDF] Modula-3: CS 520 Final Report
    May 14, 2008 · Modula-3 has features of both functional programming and BCPL-like languages. Its key fea- tures include objects, modules and interfaces, ...
  8. [8]
    Free Critical Mass Modula-3 (CM3)
    CM3 is the first open source release of Critical Mass Modula-3. It is a complete easy-to-use and easy-to-install Modula-3 system that contains considerable ...Missing: resurgence 2000s 2025
  9. [9]
    Modula-3 Resource Page
    A regression test framework based on Tinderbox has been set up. Currently only two target platforms are build nightly, but more will be added.Missing: open resurgence 2000s 2025
  10. [10]
    Syntax - Modula-3 - CS@Purdue
    Terminals are either keywords or quoted operators. The symbols Ident, Number, TextLiteral, and CharLiteral are defined in the token grammar. Each production ...Missing: lexical elements
  11. [11]
    [PDF] Modula-3: Language definition (single page)
    The original definition of Modula-3 was given in SRC Research Report 31, August 1988. It was revised in report 52, November 1989. And finally published in ...
  12. [12]
    CM Modula-3: An example
    The simplest way to run cm3 is to create a new directory, put some .m3 and .i3 files in it and then just run cm3. Cm3 will automatically scan for source files.<|control11|><|separator|>
  13. [13]
    Modula-3 - Modules
    Modules are composed of two pieces: one public, the other private. The public part is called an interface and gives only the types and procedure interfaces that ...Missing: syntax | Show results with:syntax
  14. [14]
    [PDF] Some Useful Modula-3 Interfaces - McJones
    Dec 25, 1993 · December 1986 by flipping a quarter 128 times in Andrei Broder's office at SRC. The checksum produced by the package is a function of this ...
  15. [15]
    Generics - Modula-3 - CS@Purdue
    For example, if one made the following mistake: INTERFACE String; TYPE T = ARRAY OF CHAR; END String. INTERFACE StringStack = Stack(String) END StringStack.
  16. [16]
    Modula-3: Opaque type declarations - CS@Purdue
    The actual type denoted by an opaque type name is called its concrete type. Different scopes can reveal different information about an opaque type. For ...
  17. [17]
    Modula-3: Revelations - CS@Purdue
    Distinct opaque types have distinct concrete types, since V includes a brand and all brands in a program are distinct. A revelation is allowed only in an ...
  18. [18]
    Modula-3: Example module and interface
    ### Summary of Revelation Example with Opaque Types (Stack)
  19. [19]
    Modula-3 - RAISE Stmt
    Use the RAISE statement to raise an exception <exception>. If <exception> as defined requires a parameter, one must be supplied in parenthesis. Go to the first, ...
  20. [20]
    Modula-3 - TRY-EXCEPT Stmt
    The TRY-EXCEPT statement guards statements between TRY and EXCEPT with the exception handlers between EXCEPT and END. An exception raised by a <guarded stmt> is ...
  21. [21]
    Modula-3 - TRY-FINALLY Stmt
    ... TRY-EXCEPT statement in a calling routine. NOTE: The TRY-FINALLY statement catches internal exceptions raised by all EXIT and RETURN statements. Go to the ...<|control11|><|separator|>
  22. [22]
    Modula-3: Safety
    An interface or module not explicitly labeled UNSAFE is called safe. An interface is intrinsically safe if there is no way to produce an unchecked runtime error ...Missing: mode | Show results with:mode
  23. [23]
    (PDF) Modula-3 Report (revised) - ResearchGate
    Apr 7, 2015 · PDF | On Jan 1, 1989, Luca Cardelli and others published Modula-3 Report (revised) | Find, read and cite all the research you need on ...
  24. [24]
    CM Modula-3: Garbage collection
    The current collector is, by default, incremental and generational. The interruptions of service should be very small, and the overall performance should be ...
  25. [25]
    Critical Mass Modula-3: m3core/src/weakref/WeakRef.i3
    A WeakRef.T is a data structure that refers to a node without protecting the node from the garbage collector. If w is a weak reference, we ...
  26. [26]
    [PDF] Finalization in the collector interface
    Modnla-3 has garbage collection without finalization, but extensions have been pro- posed [Hud91]. This proposal allows destructors similar to C++ and after ...
  27. [27]
    (PDF) Modula-3 Language Definition - ResearchGate
    Aug 7, 2025 · PDF | On Aug 1, 1992, Luca Cardelli and others published Modula-3 Language Definition | Find, read and cite all the research you need on ...Missing: 1988-1989 | Show results with:1988-1989<|control11|><|separator|>
  28. [28]
    Modula-3 - String Routines - CS@Columbia
    The Text interface contains routines to convert between TEXT and ARRAY OF CHAR, as well as comparing two different strings and extracting a substring from a ...Missing: manipulation | Show results with:manipulation
  29. [29]
    Modula-3: Word and Long interfaces
    And here are the logical operations on bit sequences: PROCEDURE And(x,y: T): T; (* Bitwise AND of x and y *) PROCEDURE Or (x,y: T): T; (* Bitwise OR of x and ...Missing: module | Show results with:module
  30. [30]
    CM3 Interface Index - Modula-3 @ elego
    The generic interface Stable defines a subtype of a given object type that is just like that object type, but stable. Makefile operations are provided to create ...
  31. [31]
    Implementations - Modula-3 Resource Page
    It builds upon the SRC M3 base and includes enhancements from Cambridge Modula-3. With over 15,000 files of source code, there is a large and solid existing ...Missing: resurgence 2025<|control11|><|separator|>
  32. [32]
    Free Critical Mass Modula-3 (CM3)
    It adds objects and classes, exception handling, garbage collection, lightweight processes (or threads), and the isolation of unsafe features.
  33. [33]
    FreshPorts -- lang/modula3: Critical Mass Modula-3 compiler
    Modula-3 is a systems programming language that descends from Mesa, Modula-2, Cedar, and Modula-2+. It also resembles its cousins Oberon, Object Pascal, ...
  34. [34]
    FROM C++ TO MODULA-3 ... (28 March 2024) #1177 - GitHub
    I have been very impressed with my recent experiences with Modula-3. My intent is for Modula-3 to replace C++ as my primary systems programming language.Missing: ISO abandoned<|control11|><|separator|>
  35. [35]
    Modula-3/pm3: Polytechnique Montréal Modula-3 Compiler - GitHub
    It will build bootstrap versions of "pm3", the Modula-3 compiler, and then use it to rebuild and install all the libraries and programs in the distribution.Missing: Pompey | Show results with:Pompey
  36. [36]
    Persistent Modula-3 - Purdue Computer Science
    Download PM3 here. The Persistent Programming Systems group's implementation of Persistent Modula-3 is an extension of the Modula-3 programming language with ...Missing: Pompey | Show results with:Pompey
  37. [37]
    Modula-3 - Academic Dictionaries and Encyclopedias
    ... Modula-3 is that it is one of few programming languages whose standard libraries have been formally verified not to contain various types of bugs, including ...
  38. [38]
    modula3/cm3: Critical Mass Modula-3 - GitHub
    This is the root of the Critical Mass Modula-3 Software Distribution. It may be freely distributed as open source according to the various copyrights.
  39. [39]
    SPIN is an operating system - University of Washington
    ... Modula-3 programming language. The result is a flexible operating system that helps applications run fast but doesn't crash. We have used SPIN to implement ...
  40. [40]
    [PDF] Extensibility, Safety and Performance in the SPIN Operating System ...
    SPIN is primarily written in Modula-3, which allows extensions to directly use system interfaces with- out requiring runtime conversion when communicating with ...
  41. [41]
    [PDF] Writing an Operating System with Modula-3 - UCSD CSE
    Modula-3 is an ALGOL-like, typesafe, high-level programming lan- guage that supports interfaces, objects, threads, exceptions and garbage collection.Missing: features | Show results with:features
  42. [42]
    Modula-3 Frequently Asked Questions (FAQ) - faqs.org
    Prime Time Freeware (PTF) includes Modula-3. PTF is a set of two ISO-9660 CDroms filled with 3GB of freeware, issued semi-annually. PTF is distributed via ...
  43. [43]
    [PDF] A Language with Distributed Scope - Luca Cardelli
    May 30, 1995 · Obliq supports objects in this spirit, relying for its implementation on Modula-3's network objects. [7]. The Obliq object primitives are ...
  44. [44]
    [PDF] A Language with Distributed - USENIX
    Moral: a distributed language like Obliq is easy to implement on top of a li- brary like Modula-3 Network Objects. Conversely, a network object library should.
  45. [45]
    Threads -- Issue 3 - Modula-3
    Implicit exceptions. Modula-3 defines the concept of a checked run-time error as a run-time error that must be detected and reported.Missing: unchecked | Show results with:unchecked
  46. [46]
    Books - Modula-3 Resource Page
    Feb 22, 2000 · Below is a listing of popular books related to the Modula-3 language, including on-line sources for purchasing the respective books.
  47. [47]
    Modula-3: Annotated Bibliography - Computer Science Purdue
    A highly-recommended guide to effectively writing multi-threaded programs. It uses the Modula-2+ threads library for the examples, but these are quite similar ...
  48. [48]
    Programming in Modula-3 - SpringerLink
    Free delivery 14-day returnsBook Title: Programming in Modula-3. Book Subtitle: An Introduction in Programming with Style. Authors: László Böszörményi, Carsten Weich. DOI: https://doi.org ...Missing: key | Show results with:key
  49. [49]
    Modula-3 Report (revised) - Reports & Papers - CERIAS : Purdue ...
    Modula-3 Report (revised) ; Author. Luca Cardelli,James Donahue,Lucille Glassman,Mick Jordan,Bill Kalsow,Greg Nelson ; Entry type. techreport ; Date. 1992 – ...
  50. [50]
    Modula-3 Documentation and Reports
    In the Technical Notes section, you can find a collection of reports describing various aspects of CM3-IDE and Modula-3. Feel free to print these documents or ...
  51. [51]
    Modula-3 language definition | ACM SIGPLAN Notices
    The Modula–3 type system. POPL '89: Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages.