Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
7 user(s) are online (7 user(s) are browsing encyclopedia)

Members: 0
Guests: 7

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Modula-3

Modula-3 is a programming language conceived as a successor to an upgraded version of Modula-2. It was designed by Luca Cardelli, Jim Donahue, Mick Jordan, Bill Kalsow and Greg Nelson at the Digital Equipment Corporation DEC Systems Research Center and Olivetti in the late 1980s. Its design was heavily influenced by work on the Modula-2+ language in use at DECSRC at the time, which was the language in which the operating system for the DEC Firefly multiprocessor VAX workstation was written. Modula-3 s main features are simplicity and safety while preserving the power of a systems-programming language. Modula-3 aimed to continue the Pascal programming language tradition of type safety, while introducing new constructs for practical real-world programming. In particular Modula-3 adds support for generic programming (similar to Template_(programming)), multithreading, exception handling, garbage collection (computer science), 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 programming 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 programming language, 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 features=

Exception 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. An object type (class) is introduced with the OBJECT declaration, which has essentially the same syntax as a a RECORD declaration, although the type that declared is a reference type, whereas RECORDs in Modula-3 are not (similarly to structs in C). For instance:

A = OBJECT a: INTEGER; METHODS p() := AP; END;

Defines a new object type A , which contains a single field a and method p. The procedure AP that implements p must be defined elsewhere:

PROCEDURE AP(self: A) = BEGIN ... END;

Method calls are accomplished with o.p();, where o is a variable of type A.

Modula-3 s REVEAL construct provides a conceptually simple and clean yet very powerful mechanism for hiding implementation details from clients, with arbitrarily many levels of friendliness .

In summary, the language features:

  • Modules and interfaces
  • Explicit marking of unsafe code
  • Automatic garbage collection
  • Strong typing
  • Objects
  • Exceptions
  • Threads
  • Generics
  • Several compilers are available, many of them open source.

    =Basic Syntax=

    A common example of a language s syntax is the Hello world program.

    MODULE Main; IMPORT IO; BEGIN IO.Put( Hello World ) END Main.

    =Books=

    *Greg Nelson, ed. Systems Programming with Modula-3 The definitive reference on the Modula-3 language with interesting articles on object-oriented systems software construction.

    *Samuel P. Harbison, Modula-3 Easy to use class textbook.

    *Robert Sedgewick, Algorithms in Modula-3

    *Laszlo Boszormenyi & Carsten Weich, Programming in Modula-3: An Introduction in Programming in Style

    =External links=

    *[http://www.research.compaq.com/SRC/modula-3/html/home.html Modula-3 Home Page] *[http://www.m3.org Modula-3 Resource Page] *[http://www.research.compaq.com/SRC/m3defn/html/complete.html Modula-3: Language definition] *[http://www.ugcs.caltech.edu/~cs2 A freshman programming class taught in Modula-3]