SPIN Modula-3

We've made a bunch of changes to Modula-3. We also have a bunch of recommendations on safe programming in our version of M3.

Style guide

Certain guidelines should be followed when programming using objects.

Language changes

Here are the changes we have made from standard Modula-3, including motivation for the change, new syntax and some examples. A paper describes most of these changes in more detail.
VIEW
Typesafe casting
EPHEMERAL procedures
Procedures which guarantee they won't screw up the system even if they are terminated at an arbitrary point.
FUNCTIONAL procedures
Procedures which don't modify any global state.
PROCANY type
A supertype for all PROCEDURE types.
RTCode interface
An way to talk about Modula-3 modules and interfaces at runtime.
EXTERNAL is UNSAFE
Any interface containing <*EXTERNAL*> declarations must be UNSAFE.
IMPLICIT exceptions
Exceptions that every procedure may raise, and that do not need to be declared.
ALIGNED FOR
You can boost the alignment of types that need it.
Object methods
Calling and naming object methods explicitly is restricted.
CVAR
Calling C functions with call-by-reference.

Compiler options

We have added the following compiler options:
-NoLoopholeWarnings
Do not give warnings for LOOPHOLE. Our compiler issues a warning for every loophole.
-SpinRelax
Turn off SPIN restrictions, so that standard code can be compiled. For example, turn off the requirement that EXTERNAL be UNSAFE.


Last changed July 17, 1996
whsieh@cs.washington.edu