Modula-2 Name Greeting - Modula2 Typing CST Test
Loading…
Modula-2 Name Greeting — Modula2 Code
Greets users by name.
MODULE Greet;
IMPORT InOut;
PROCEDURE greet(name: ARRAY OF CHAR);
BEGIN
InOut.WriteString("Hello, "); InOut.WriteString(name); InOut.WriteString("! Welcome!"); InOut.WriteLn;
END greet;
BEGIN
greet("Saurav");
greet("Alice");
greet("Bob");
END Greet.Modula2 Language Guide
Modula-2 is a statically typed, modular, procedural programming language designed for systems programming and teaching structured programming concepts, created as a successor to Pascal.
Primary Use Cases
- ▸Teaching structured and modular programming
- ▸Systems programming and embedded applications
- ▸Operating system and compiler development
- ▸Prototyping modular software architectures
- ▸Applications requiring strong type safety
Notable Features
- ▸Module system for encapsulation
- ▸Strong static typing
- ▸Procedural programming with structured control
- ▸Separate compilation for modules
- ▸Support for low-level systems programming
Origin & Creator
Developed by Niklaus Wirth in 1978 at ETH Zurich as a follow-up to Pascal, focusing on modularity and systems programming.
Industrial Note
Modula-2 found niche use in teaching programming concepts, embedded systems, and certain early OS development projects, though modern usage is mostly academic.