@menu
* What is GNU Modula-2:: Brief description of GNU Modula-2.
* Why use GNU Modula-2:: Advantages of GNU Modula-2.
-* News:: Latest news about GNU Modula-2.
* Development:: How to get source code using git.
-* Obtaining:: Where to get the source code using git.
* Features:: GNU Modula-2 Features
@end menu
platforms. gm2 builds and runs on powerpc64le, amd64, i386, aarch64
to name but a few processors.
+gm2 can produce swig interface headers to allow access from Python and
+other scripting languages. It can also be used with C/C++ and
+generate shared libraries.
+
The compiler provides semantic analysis and runtime checking (full ISO
Modula-2 checking is implemented) and there is a plugin which can,
under certain conditions, detect runtime errors at compile time.
-gm2 can produce swig interface headers to allow access from Python and
-other scripting languages. The compiler supports PIM2, PIM3, PIM4 and
-ISO dialects of Modula-2, work is underway to implement M2R10. Many
-of the GCC builtins are available and access to assembly programming
-is achieved using the same syntax as that used by GCC.
+The compiler supports PIM2, PIM3, PIM4 and ISO dialects of Modula-2,
+work is underway to implement M2R10. Many of the GCC builtins are
+available and access to assembly programming is achieved using the
+same syntax as that used by GCC.
+
+The gm2 driver allows third party libraries to be installed alongside
+gm2 libraries. For example if the user specifies library @code{foo}
+using @code{-flibs=foo} the driver will check the standard GCC install
+directory for a subdirectory.
-@node Release map, News, Why use GNU Modula-2, Using
+@node Release map, Development, Why use GNU Modula-2, Using
@section Release map
GNU Modula-2 is now part of GCC and therefore will adopt the GCC
-release schedule with a git branches matching the various GCC release
-numbers. It is intended that GNU Modula-2 implement more of the GCC
-builtins (vararg access) and GCC features.
-
-There is an intention to implement the M2R10 dialect of Modula-2 and
-any of the language changes. If you wish to see something different
-please email @email{gm2@@nongnu.org} with your ideas.
-
-@node News, Features, Release map, Using
-@section News
-
-@table @code
+release schedule. It is intended that GNU Modula-2 implement more of
+the GCC builtins (vararg access) and GCC features.
-@item gm2 release numbers
-are now superceded by gcc branch numbers as gm2
-is tracking the gcc release model.
-
-@item accuracy of error messages
-has been improved and offending subexpressions are now highlighted.
-
-@item new type checker
-has been implemented which will check
-all data types, including recursive procedure parameter types.
-
-@item libraries
-the gm2 driver program has been enhanced to allow third party
-libraries to be installed alongside gm2 libraries. For example if the
-user specifies library @code{foo} using @code{-flibs=foo} the driver
-will check the standard GCC install directory for a subdirectory
-@code{foo}.
-
-@item libpth
-has been removed from gm2 and the coroutines are now implemented using
-the gcc portable threading library.
-
-@item libulm
-the Ulm libraries have been removed from the gm2 tree as they were not
-GPL3.
-
-@item Talk given at The GNU Tools Cauldron 2018
-here is a talk on GNU Modula-2 given at
-@url{https://gcc.gnu.org/wiki/cauldron2018,The GNU Tools Cauldron},
-Manchester on 8th September 2018.
-The title is, ``GNU Modula-2 update, catching semantic errors post
-code optimisation and improved debugging''
-[@url{https://splendidisolation.ddns.net/Papers/paper23/talk.pdf,slides}
-and @url{https://www.youtube.com/watch?v=6jf6weRuHjk,video}].
-
-@item gm2 1.8.2
-was released on Aug 30th 2018. gm2-1.8.2 grafts onto gcc-8.2.0
-and contains integer overflow detection for addition, subtraction,
-negation and multiplication. It also detects and traps when
-a floating point nan occurs. This is the first release with the
-new semantic checking plugin which checks whether any exception
-will occur post optimization (see -fsoft-check-all). The compiler
-also works well with the automake tools.
-
-@item gm2 1.2.0
-was released on May 11th 2017. gm2-1.2.0 grafts onto gcc-5.2.0 and
-supports much better line number accuracy in debugging output.
-Source to code relationship can be further improved by the new option
--fm2-g. -fm2-whole-program also provides whole program optimization.
-@item Talk given at The GNU Tools Cauldron 2016
-here is a talk on GNU Modula-2 given at
-@url{https://gcc.gnu.org/wiki/cauldron2016,The GNU Tools Cauldron},
-Hebden Bridge on 9th September 2016.
-The title is, ``GNU Modula-2 status, whole
-program optimisation and language interoperability''
-[@url{https://splendidisolation.ddns.net/Papers/paper22/talk.pdf,slides}
-and @url{https://www.youtube.com/watch?v=8GMyxwHdr1E,video}].
-@item gm2 1.1.6
-was released on February 22nd 2016. gm2-1.1.6 grafts onto gcc-4.7.4.
-@item gm2 1.1.5
-was released on September 3 2015, passes all regression tests and has
-many bug fixes applied. Arrays and Records can be assigned to and from
-WORD, LOC, BYTE providing sizes permit. Also a small number of fixes
-to the library module MemStream.mod. Fixed a number of bugs shown by
-valgrind.
-@item gm2 1.1.3
-was released on April 15 2015. gm2-1.1.3 passes all regression
-tests on Debian Wheezy (x86_64) and (i686). Also passes all regression tests
-under Debian Jessie (x86_64). It also builds on armv7l Ubuntu Trusty Tahr.
-@item gm2 1.1.1
-was released on January 26 2015. gm2-1.1.1 passes all regression
-tests on Debian Wheezy (x86_64) and (i686). Also passes all regression tests
-under Debian Jessie (x86_64).
-@item gm2 1.1.0
-was released on January 02 2015. gm2-1.1.0 passes all regression
-tests on Debian Wheezy (x86_64) and (i686).
-@item gm2 1.0.9
-Beta was released on September 23 2014, all regressions passed on
-x86_64 Debian Wheezy.
-@item gm2 1.0.4
-was released on September 30 2011. This is a bug fix release.
-@item gm2 1.0
-was released on December 11 2010.
-@end table
+There is an intention to implement the ISO generics and the M2R10
+dialect of Modula-2. It will also implement all language changes. If
+you wish to see something different please email
+@email{gm2@@nongnu.org} with your ideas.
-@node Development, Obtaining, News, Using
+@node Development, Features, Release map, Using
@section How to get source code using git
-GNU Modula-2 is in the process of migrating into the
-@url{https://gcc.gnu.org/git.html, GCC git tree}. The development
-branch is available via git:
-
-@example
-$ git clone git://gcc.gnu.org/git/gcc.git gcc-git-devel-modula2
-$ cd gcc-git-devel-modula2
-$ git checkout devel/modula-2
-$ cd ..
-@end example
-
-@node Obtaining, Features, Development, Using
-
-GNU Modula-2 is in the process of migrating into the
-@url{https://gcc.gnu.org/git.html, GCC git tree}.
-@xref{Development, , ,gm2} section in this GM2 documentation for git
-details and @xref{Downloading the source, , ,gcc} in the GCC
-documentation.
+GNU Modula-2 is now in the @url{https://gcc.gnu.org/git.html, GCC git
+tree}.
-@node Features, Documentation, News, Using
+@node Features, Documentation, Development, Using
@section GNU Modula-2 Features
@itemize @bullet
@ifnothtml
@c omit these nodes if generating gm2 webpage as these are hand written.
* Release map:: Release map.
-* News:: News.
* Development:: Development.
-* Obtaining:: How to Obtain GNU Modula-2.
* Features:: Features of the implementation.
* Documentation:: Placeholder for how to access the documentation online.
* Regression tests:: How to run the testsuite.
@c turn on the Modula-2 function line number generation (internal switch)
@item -fdef=
-recognise the specified suffix as a definition module filename.
+recognize the specified suffix as a definition module filename.
The default implmentation and module filename suffix is @file{.def}.
If this option is used GNU Modula-2 will still fall back to this
default if a requested definition module is not found.
performance improvements.
@item -fmod=
-recognise the specified suffix as implementation and module filenames.
+recognize the specified suffix as implementation and module filenames.
The default implmentation and module filename suffix is @file{.mod}.
If this option is used GNU Modula-2 will still fall back to this
default if it needs to read an implmentation module and the specified
and @samp{-fiso} can be used to force mutually exclusive
features. However by default the compiler will not aggressively fail
if a non mutually exclusive feature is used from another dialect. For
-example it is possible to specify @samp{-fpim2} and still utilise
+example it is possible to specify @samp{-fpim2} and still utilize
@samp{DEFINITION} @samp{MODULES} which have no export list.
Some dialect differences will force a compile time error, for example
END NEWCOROUTINE ;
@end example
-Note that it is illegal for this declaration to contain an initialiser
+Note that it is illegal for this declaration to contain an initializer
value for @code{initProtection}. However it is necessary to surround
this parameter with the brackets @code{[} and @code{]}. This serves to
remind the programmer that the last parameter was declared as optional
COMPLEX128 SYSTEM
@end example
-The Modula-2 language categorises compatibility between entities of
+The Modula-2 language categorizes compatibility between entities of
possibly differing types into three subcomponents: expressions,
assignments, and parameters. Parameter compatibility is further
divided into two sections for pass by reference and pass by value
and it can be compiled by:
-@samp{gm2 -g -I. hello.mod -lc}
+@samp{gm2 -g hello.mod -lc}
In reality the @samp{-lc} is redundant as libc is always included in the
-linking process. It is shown here to emphasize that the C library or
-object file containing @code{printf} must be present.
+linking process. It is shown here to emphasize that the C library or
+object file containing @code{printf} must be present. The search path
+for modules can be changed by using @samp{-I}.
If a procedure function is declared using varargs then some parameter
-values are converted. The table below summarises the default conversions
+values are converted. The table below summarizes the default conversions
and default types used.
@example
@end example
This indicates that the function @code{sqrt} will be implemented using
-the gcc built-in maths library. If gcc cannot utilise the built-in
+the gcc built-in maths library. If gcc cannot utilize the built-in
function (for example if the programmer requested the address of
@code{sqrt}) then code is generated to call the alternative function
implemented in the @code{IMPLEMENTATION} @code{MODULE}.