HOME

Resources

Compilers Tutorials/Papers Libs/Sources Newsgroups FAQ Forums/Lists

Special Areas

GNU Modula-2 Modula-2 CGI Tutorial Howto Setup a Fine Modula-2 Environment Programming with Modula-2 Misc. Modula-2 Related Pages Not-English Modula-2 Pages Downloads Please Sign My Guestbook Code Search

Recommended Links

GNU Modula-2

Modula-2 home page

Frequently Asked Questions

There are two FAQ's available on the net: The Modula-2 FAQ compiled by Rick Sutcliffe - This is something like the "official Modula-2 FAQ". The document is being updated and is highly recommended lecture for people new to Modula-2.
There's another FAQ online which is a bit dated (last modified 1995): questions compiled from comp.lang.modula2.


[ top ]  Local FAQ

This section is (and will always be) under construction. Every now and then I'll add questions and answers here wich I missed when searching the web. What's to appear here depends on your or my interest - suggestions welcome -

1. Is Modula-2 a so called "Object Oriented Language" ?
2. Debugging Modula-2 programs
3. Modula-2 is a language for systems programming - right?
4. Modula-2 and POSIX?
5. Where can I get information about ISO Modula-2?
6. Is there any Information available on Real Time Programming?
7. Exceptions and Modula-2?
8. What about translating C to Modula-2?
9. Modula-2 and Ada95?
10. What about Modula, the predecessor of Modula-2?


[ top ] 1. Is Modula-2 a so called "Object Oriented Language" ?
 (A)
Yes, but it depends on the standard a compiler implements. Some time after the Modula-2 ISO-Standard was released, object orientation has also been standardized. The project was "JTC 1.22.18.02 Object Oriented Extensions for Modula-2". From the ISO/IEC JTC1/SC22/WG13 Homepage (wich is "the international standardization working group for the programming language Modula-2"): "The model chosen for object oriented extensions has both modules and classes; has single inheritance and has multiple roots. The document has been published as ISO/IEC 10514-2:1998." The only compilers available implementing these extensions - as far as I know - are (1) ADW Modula-2 which is available as freeware and (2) p1 Modula-2 which is a commercial product for Apple computers.
 (B)
Roger Carvalho implemented some OO-Extensions in the last versions of FST Modula-2 (3.5+).
 (C)
You can find some information on Object Oriented Modula-2 at ULM's FTP Server.


[ top ] 2. Debugging Modula-2 programs
 (A)
There is a way to use Turbo Debugger for programs compiled with FST Modula-2. Julian Miglio found out how to and has kindly provided an explanation plus example. Fetch the .zip from the download-area.
 (B)
M2F and GNU Modula-2 generate debug-information for GDB.
 (C)
There are some problems with Gardens Point Modula-2, for example have a look at http://sources.redhat.com/ml/gdb/2002-05/msg00048.html. I think the above also applies to the DJGPP-version of GPM. If you want to try DJGPP/GPM and GDB, you may want to have a look at RHIDE - available from http://www.rhide.com. This is an IDE integrating GDB.
 (D)
Working on a Windows-platform, maybe the best idea is using XDS-Modula-2. The package is freeware now and comes with a native win32-debugger. Download at http://www.excelsior-usa.com/xdsx86.html.


[ top ] 3. Modula-2 is a language for systems programming - right?
 (A)
Niklaus Wirth developed Modula-2 as a language for programming the Lilith-workstation (Modula, the predecessor of M-2 was already implemented on a PDP-11). From ETH: "The first Modula-2 compiler was completed at ETH in 1979. It was implemented on a PDP-11 computer and then ported onto Lilith." If you are interested in design and implementation of the system which was called Medos-2 check Svend Erik Knudsens doctoral thesis "Medos-2: A Modula-2 Oriented Operating System for the Personal Computer Lilith (1983)" to learn more about the system.
 (B)
There is an Operating System called LUMOS for a computer called "Stride 440". These were Motorola 68k machines usually running System V UNIX. You can find some information using Google. Read a short description of the system. I thought the whole thing disappeared completely, so I asked in comp.lang.modula2 - the same day Alexander Naumov made the Sources of LUMOS-2 available again. Note that it is a real multi-user operating system in comparison to Medos-2 which was a single-user system.
 (C)
Kronos was (is) a 32-bit workstation developed in Akademgorodok, a research center of the Russian Academy of Science. It was based on the Lilith personal computer designed by Niklaus Wirth. There is a lot of information available at the homepage of the Kronos research group. The source code of the system is available under a BSD-license.
 (D)
Writing a complex system such as an operating system also makes PMOS by Peter Moylan very interesting for you. A short description from the homepage: "PMOS is a large library of Modula-2 modules, distributed in source form. Its primary purpose is to make it easy to write multitasking programs for real-time and/or embedded applications. However it also contains a number of modules of interest even if you don't want to write multitasking code: screen windows and screen graphics modules, various device drivers, and a variety of utility modules."
 (E)
Gaius Mulley, developer of GNU Modula-2, wrote a microkernel called LUK which he uses to teach students the principles of microkernels. LUK runs on x86 PC hardware and boots from a USB memory stick. Follow the link above to get more information and a download link.
 (F)
Some papers and reports about other operating systems written in Modula-2 are available from libraries and sites charging you for downloading academic papers. There was Panos for example, an operating system developed by Acorn Computers in the 1980s (information from computinghistory.org.uk), which ran on the 32016 Second Processor for the BBC Micro and the Acorn Cambridge Workstation. For those interested there is a lot of information including pictures and manuals available from Chris's Acorns. Acorn also developed ARX, an operating system written in Modula-2+. The language has also been used to develop Topaz (.pdf), an operating system for the DEC SRC Firefly Multiprocessor. And a few other links to start reading: A portable modula-2 operating system: SAM2S, A simple nucleus written in modula-2: A case study, Modula-2 for real-time systems.
 (G)
You may also be interested in Native Oberon, which is an amazing operating system that can be easily installed on nearly every PC. There's also Bluebottle-OS, which is even more impressive. Description from homepage: "Bluebottle is a powerful operating system based on the Active Object System (Aos) kernel. It provides a compact runtime environment for the Active Oberon language ( pdf), which supports active objects directly, and enables the construction of efficient active object-based systems that run directly on the hardware. Above this layer is a flexible collection of modules providing generic abstractions for devices and services, e.g., file systems, user interfaces and TCP/IP networking". Just have a look - but you'll have to write Oberon which is quite different to Modula-2.
 (G)
Last but not least there is the operating system SPIN which is mostly coded in Modula-3. The homepage of the project contains lots of useful information. You may want to start by reading the SPIN Overview or the paper Writing an Operating System with Modula-3.



[ top ] 4. Modula-2 and POSIX?
 (A)
There was work being done on the ISO-project "JTC1.22.03 -- Modula-2 to Posix Binding" but the project was cancelled. Pat Terry notes that this project was a child of Mr. Keith Hopper who had to withdraw because of health problems. After he left the project fell by the wayside. "In view of Keith's ill health, a decision was made to abandon the POSIX project in favour of one that would examine the bindings to C." I am searching for Output of this project. Any advice?
 (B)
A POSIX-library comes (incomplete ?) with XDS-Modula-2. After installing have a look in the subdirectory /def/posix;
 (C)
Holger Kleinschmidt has written M2LIB which is available from the download-area and implements calls to POSIX-functions. The library was written for a variety of Atari compilers, so it's quite hard to get things going on the x86 architecture.



[ top ] 5. Where can I get information about ISO Modula-2?
 (A)
The book "Abstractions for Data and Programming Structures (Using ISO-Standard Modula-2)" by R. Sutcliffe. This is a Sharebook (!). There were only a few books published after the standard came out. Anyone has a list of books dealing with ISO M2?
 (B)
Some documents (draft 4 of the ISO standard;) can still be found and downloaded. But this material differs slightly from the standard.
 (C)
Some information can also be found at the official homepage of WG 13 / Modula-2, the international standardization working group for the programming language Modula-2.
 (D)
Maybe the best idea to start is reading through the definition modules of the ISO Modula-2 Library (coming with XDS or GPM for example). Note that the ISO Library is not the same as the language ISO Modula-2, but one gets an idea of how powerful the new concepts are (channels, exceptions etc.).
 (E)
The standard itself can be bought at the International Organization for Standardization itself. This is in my opinion quite expensive. Here are the relevant links for Modula-2:



[ top ] 6. Is there any Information available on Real Time Programming?
I haven't found a lot of informantion yet. Some courses on the topic were held at ETH Zuerich. Some (german) pdfs can be found via search machines. You may also want to have a look at PMOS by Peter Moylan which claims to be a good starting point for "people who want to write real-time applications for the IBM-PC."



[ top ] 7. Exceptions and Modula-2?
In my humble opinion this is one of the nice concepts introduced with ISO Modula-2 (not really ISO: I had to learn that Niklaus Wirth already had an implementation of exceptions on the PDP-11 version of the Modula-2 compiler - that was 1979! Thank you people for pointing this out in comp.lang.modula2; Borland Turbo Modula-2 also had exceptions as an extension;). Exceptions are a really powerful way of handling exceptional situations that are errors of your program. Look at this example program structure which does NOT make your programs more complicated - this reduces complexity:

MODULE m2except;
 (* import, const, type, var stuff *)
BEGIN
 (* program code *)
FINALLY
 (* finalize your program before exiting *)
EXCEPT
 (* tell the program what to do in exceptional situations *)
END m2except.

The standard ISO Modula-2 library comes with predefined modules for common Modula-2 exceptions (the module collects everything from division by zero to range-errors and so on;) but it is also possible to define user exceptions. For example XDS Modula-2 comes with a Module GeneralUserExceptions to demonstrate how it is done. Exception handling is a powerful thing but one should read where they make sense and what errors they should catch. When I started with exceptions I raised one every tick my program made: but as the name says, usually a program should only raise an exception when something really unexpected happens. Well, that's my understanding at the moment.



[ top ] 8. What about translating C to Modula-2?
 (A)
Usually one will meet people who want to translate Modula-2 to C, so there aren't (and weren't) many hints available on this topic. Don't even think of free and usable software. I found two (1,2) posts from comp.compilers which led me to a company called Knowledge Software Ltd. which has already designed a C to Modula-2 translator but as there weren't enough requests the thing was never implemented. Note they would still implement it if someone is willing to pay for it.
 (B)
There is a project at SourceForge called OpenC2Pas. This is still in an early stage but maybe it's a good starting point for working on OpenC2Mod. Before you begin working on a translator search Google Groups to get an idea what problems are awaiting you: producing readable Modula-2 code seems to be nearly impossible. Just think of all the things that are done with the C-preprocessor... Those who still use some flavor of good old Dos may want to have a look at C2PAS by L. B. Neal. This is a simple C to Turbo Pascal Translator which might be helpful on the long way from C to Modula-2.
 (C)
Don't forget the utilities coming with GNU Modula-2 and XDS Modula-2. Both compilers provide a program which translates header files to definition modules.



[ top ] 9. Modula-2 and Ada95?
If you are searching for information on how to migrate from Modula-2 to Ada95, you may want to have a look at section compilers -> translators. You can find some information on translating Modula-2 to Ada when following the link provided there.



[ top ] 10. What about Modula, the predecessor of Modula-2?
Yes, there were implementations of Modula (also called Modula-1 sometimes), most important the implementation following the definition of the language by Niklaus Wirth himself on a PDP-11 (another reference). The Hexapus system was written using this compiler. You can find the basic references to Modula and Hexapus in the book The school of Niklaus Wirth: the art of simplicity (page 9). Very soon other implementations followed, most important the University of York Modula compiler (some interesting notes about the language are available as part of a presentation by the Real-Time Systems Research Group at the university of York) and a compiler developed at Philips Laboratories named PL Modula which generated code for the LSI-11 microprocessor.
As Ian Cottam points out there was a project to write a kernel in Modula: Cottam was "a consultant to Ford Aerospace Corp. of Palo Alto, USA, on their use of the York Modula compiler for a secure and dependable UNIX kernel project". Another paper by William R. Bevier (his dissertation) provides some references and a little insight: "A group at Ford Aerospace designed a kernelized secure operating system (KSOS) intended to provide a secure operating system with an interface compatible with UNIX. [...] An implementation was written in MODULA, but code proofs were not anticipated and not done." Find more information in the KSOS Executive Summary and in the KSOS Final Report by Ford Aerospace and Communications Corp. The operating system was written for the US department of defense (for DARPA). Another presentation describes more details of the system as well as its importance for the development of operating systems. KSOS should replace UNIX v6! Just use a search engine to find even more.
Other projects can be found, for example Software for an air pollution measuring system: An application of modula (an article by J. M. Dubery and A. J. Pinches). In an article about programming languages used at CERN Modula-1 is mentioned as well - here I am not so sure if this wasn't a typo. Definitly Modula-1 is mentioned in recent and also in somehow dated documents. Well, I know these are no perfect citations and references but a few good starting points to find literature about Modula.





Get more information


FMP RSS Feed

IRC Modula-2 Chat

Modula-2 Webring
[ List_all | Random | Join ]
[ Prev | Next ]

Google


dmoz



Contact, suggestions, submission of news items: contact information