![]() |
|
|||||||||||||||||
Modula-3(Redirected from Modula-3 programming language)
Modula-3 is a programming language conceived as a successor to Modula-2. It was designed by Luca Cardelli, Jim Donahue, Mick Jordan, Bill Kalsow and Greg Nelson at the DEC Systems Research Center and Olivetti in the late 1980s. Its main features are simplicity and safety while preserving the power of a systems-programming language. Modula-3 aimed to continue the Pascal tradition of type safety, while introducing new constructs for practical real-world programming. In particular Modula-3 adds support for generic programming (similar to templates), multithreading, exception handling, garbage collection, object-oriented programming, partial revelation and encapsulation of unsafe code. The design goal of Modula-3 was a language that implements the most important features of modern imperative languages in quite basic forms. Thus dangerous and complicating features like multiple inheritance and operator overloading were omitted. The Modula-3 project started in November 1986 when Maurice Wilkes wrote to Niklaus Wirth with some ideas for a new version of Modula. Wilkes had been working at DEC just prior to this point, and had returned to England and joined Olivetti's Research Strategy Board. Wirth had already moved on to Oberon, but had no problems with the Wilkes' team continuing development under the Modula name. The language definition was completed in August 1988, and an updated version in January 1989. Compilers from DEC and Olivetti soon followed, and 3rd party implementations after that. Language featuresException handling is based on the now-traditional TRY...EXCEPT block system, the only difference being that the EXCEPT construct defined a pseudo-CASE with each possible exception as a case in one EXCEPT clause. Modula-3 also supports a LOOP...EXIT...END construct that loops until an EXIT occurs, a structure equivalent to a simple loop inside of a TRY...EXCEPT clause. Object support is intentionally kept to its simplest terms. A class is introduced with the OBJECT declaration, which is essentially a RECORD with some specific syntax. For instance:
Defines a new class "A", which contains a single field "a" and method p. The procedure AP that implements p must be defined elsewhere:
Method calls are accomplished with Modula-3's In summary, the language features:
Several compilers are available, many of them open source. Basic SyntaxA common example of a language's syntax is the Hello world program.
MODULE Main;
IMPORT IO;
BEGIN
IO.Put("Hello World\n");
END Main.
External linksThe contents of this article are licensed from Wikipedia.org under the GNU Free Documentation License.
How to see transparent copy 01-04-2007 01:21:04 |
|





