# Modula-2

> programming language

**Wikidata**: [Q777358](https://www.wikidata.org/wiki/Q777358)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/Modula-2)  
**Source**: https://4ort.xyz/entity/modula-2

## Summary

Modula-2 is a software application influenced by Mesa and Modula[1][2].

## Summary
Modula-2 is an imperative, systems programming language designed by Swiss computer scientist Niklaus Wirth in 1978 as a successor to his earlier language Modula. It emphasizes modular programming, static typing, and structured software design, influencing later languages like Modula-3 and Oberon. Developed for reliable systems programming, it introduced key concepts such as strict separation of interfaces and implementations.

## Key Facts
- **Inception**: 1978, designed by Niklaus Wirth.
- **Based on**: Modula (1975), influenced by Mesa and Pascal.
- **Typing discipline**: Static, strong, and safe typing.
- **Programming paradigms**: Imperative, structured, modular, and concurrent computing.
- **Successors**: Modula-3 (1989), Oberon (1987), and Modula-2+ (1984).
- **Notable compilers**: ORCA/Modula-2 (1994) for Apple IIGS.
- **File formats**: `.mod` (source code), `.m2` (common extensions).
- **Classifications**: Imperative programming language, systems programming language.

## FAQs
### Q: Who created Modula-2 and when?
A: Modula-2 was designed by Niklaus Wirth, a Swiss computer scientist, and first published in 1978.

### Q: What is Modula-2 used for?
A: It is primarily used for systems programming, emphasizing reliability and modular design for applications requiring low-level hardware interaction.

### Q: How does Modula-2 relate to other languages like Pascal or Oberon?
A: Modula-2 evolved from Wirth’s earlier work on Pascal and Modula. It directly influenced later languages such as Modula-3 and Oberon, which expanded its concepts for object-oriented and distributed systems programming.

## Why It Matters
Modula-2 played a pivotal role in advancing software engineering practices through its emphasis on modular design, strict type checking, and separation of concerns. It addressed limitations of earlier languages like Pascal by adding features for concurrent programming and efficient systems development. While not as widely adopted as C or C++, its principles shaped modern systems programming languages and educational curricula in computer science. Its influence is seen in successors like Oberon and in embedded systems where reliability and clarity are critical.

## Notable For
- **Modular programming**: Introduced a strict module system to organize code into reusable, self-contained units.
- **Static typing**: Enforced type safety at compile time to prevent runtime errors.
- **Influence on later languages**: Directly inspired Modula-3, Oberon, and indirectly affected languages like Go and Seed7.
- **Educational impact**: Widely taught in computer science courses during the 1980s–1990s to emphasize structured programming practices.

## Body
### Origins and Development
- Designed by Niklaus Wirth at ETH Zurich, published in 1978 as a refinement of his 1975 Modula language.
- Initially implemented for the Lilith computer, a workstation developed by Wirth’s team.

### Design Philosophy
- **Modularity**: Required explicit import/export of modules to enforce information hiding.
- **Efficiency**: Optimized for systems programming with low-level memory management and hardware access.
- **Safety**: Strong type system and absence of implicit type conversions to ensure reliability.

### Key Features
- **Syntax**: Similar to Pascal but with added module constructs and support for concurrent processes.
- **Typing**: Supported static typing with compile-time checks for type consistency.
- **Concurrency**: Included primitives for concurrent programming (e.g., processes, signals).

### Legacy and Variants
- **Modula-2+** (1984): An extended version developed at DEC for large-scale systems.
- **Modula-3** (1989): Added object-oriented features and garbage collection.
- **Oberon** (1987): A minimalist successor integrating Modula-2’s concepts with object-oriented programming.

### Applications
- **Embedded systems**: Used in industrial control systems and real-time applications.
- **Academia**: Taught in university courses to illustrate modular design principles.
- **Legacy systems**: Maintained in niche environments like the Apple IIGS (via ORCA/Modula-2).

## Schema Markup
```json
{
  "@context": "https://schema.org",
  "@type": "Thing",
  "name": "Modula-2",
  "description": "An imperative, systems programming language designed by Niklaus Wirth in 1978, emphasizing modular design and static typing.",
  "url": "https://en.wikipedia.org/wiki/Modula-2",
  "sameAs": [
    "https://www.wikidata.org/wiki/Q827505",
    "https://en.wikipedia.org/wiki/Modula-2"
  ],
  "additionalType": [
    "https://schema.org/ComputerLanguage",
    "https://www.wikidata.org/entity/Q827505"
  ],
  "creator": {
    "@type": "Person",
    "name": "Niklaus Wirth"
  },
  "datePublished": "1978"
}

## References

1. Programming in Modula-2. Programming in Modula-2
2. [Source](https://github.com/JohnMarkOckerbloom/ftl/blob/master/data/wikimap)
3. Programming in Modula-2
4. Freebase Data Dumps. 2013
5. [Source](https://people.inf.ethz.ch/wirth/projects.html)
6. National Library of Israel