Date: 2026-10-22 ยท V3 state: v3-proc-types (suite 255/255,
self-hosting fixpoint OK 3,935,235 bytes, corpus 503/612, 0 crashes).
Scope. PIM4 is Wirth's Programming in Modula-2, 4th edition (the language specification, not a compiler). GNU Modula-2 (gm2) is the GCC front end: its PIM and ISO modes plus the extensions common in its testsuite. V3 is this compiler: a PIM/ISO subset plus the gm2 compatibility it deliberately chose.
Legend: โ supported / standard ยท ๐ partial or caveated ยท โ absent ยท โ ๏ธ non-standard extension ยท n/a not applicable.
The tables describe the common/default behaviour; the exact flags and modes of gm2 can change individual cells. V3's deliberate deviations are listed at the end.
| Feature | PIM4 | GNU Modula-2 | V3 |
|---|---|---|---|
| PIM base language | โ (definition) | โ (PIM 2/3/4 modes) | โ (PIM/ISO subset) |
| ISO 10514-1 base | โ (predates ISO) | โ | ๐ mostly; see missing ISO rows below |
| ISO 10514-2 generics | โ | โ | โ (refinement form) |
| ISO 10514-3 OO | โ | โ | โ (CLASS is Clarion-form, not ISO OO) |
| Declaration before use | โ strict | ๐ multi-pass, accepts forward refs | โ strict for data; ๐ forward procedure calls allowed |
FORWARD declarations |
โ | โ | โ |
EXPORT QUALIFIED / UNQUALIFIED |
โ (PIM export list only) | โ | โ |
Foreign modules (DEFINITION MODULE FOR "C") |
โ | โ | โ |
| Feature | PIM4 | GNU Modula-2 | V3 |
|---|---|---|---|
Identifiers with _ |
โ (classic names) | โ | โ |
| Numeric bases | โ
octal B, hex H |
โ
B/H (and more) |
โ (0x/0X only; 012H/666B rejected) |
Nested (* *) comments |
โ | โ | โ |
'โฆ' and "โฆ" strings |
โ | โ | โ |
Unicode UCHAR/UString |
โ | โ | โ
(extension: U'a', U"โฆ", UCHR, UORD) |
| Feature | PIM4 | GNU Modula-2 | V3 |
|---|---|---|---|
INTEGER/CARDINAL/SHORTINT/LONGINT, REAL/LONGREAL, BOOLEAN, CHAR |
โ | โ | โ |
| Subranges | โ | โ | โ (typed CHAR/enum subranges since 2026-10-22) |
| Enumerations | โ | โ | โ |
Sets (SET OF) |
โ any finite ordinal (impl. limit) | โ | ๐ bool/char/enum/small-int subrange; span โค 65536; no SET OF CARDINAL |
PACKEDSET |
โ (ISO) | โ | โ |
| Fixed arrays, multi-dimensional | โ
ARRAY [a], [b] OF |
โ | โ
both [a], [b] and [a, b] |
| Open arrays (1-D) | โ | โ | โ |
| Multi-dimensional open arrays | โ (ISO addition) | โ | โ (V3 descriptor-per-level representation; unbounded* gaps) |
| Records, variant records | โ | โ | โ
(plus empty arms/ELSE extensions) |
Pointers, NIL, opaque types |
โ | โ | โ |
| Procedure types | โ
(PROCEDURE) |
โ
(PROCEDURE, PROC) |
โ
(PROCEDURE, PROC; comma/unnamed forms) |
Complex types (COMPLEX, LONGCOMPLEX) |
โ | โ (ISO) | โ (COMPLEX64 is a REAL placeholder, no arithmetic) |
SYSTEM sized types (WORD32, CARDINAL8, BITSET32, โฆ) |
โ | โ | โ names, but mapped to V3's 32-bit/64-bit model |
BYTE granularity |
โ 8-bit | โ 8-bit | ๐ BYTE = 32-bit CARDINAL; ARRAY OF BYTE is not byte-granular |
SHORTREAL (32-bit) |
โ | โ | โ (all reals are 8 bytes) |
ADDRESS arithmetic (ADDADR/SUBADR/DIFADR) |
โ | โ | โ |
Absolute variables VAR [addr]: T |
โ | โ (extension) | โ |
Set ordering (<, <=, >, >=) |
โ (=/#/IN only) |
โ (extension) | โ |
| Feature | PIM4 | GNU Modula-2 | V3 |
|---|---|---|---|
IF/CASE/WHILE/REPEAT/LOOP/EXIT/WITH, RETURN, HALT |
โ | โ | โ |
FOR over any ordinal (CHAR/enum) |
โ | โ | โ (since 2026-10-22) |
GOTO / labels |
โ | โ | โ |
INC/DEC on enumerations |
โ (integer) | โ | โ (integer only) |
Empty string ""/'' as CHAR |
โ/unclear (ISO rule) | โ | โ (ISO rule, since 2026-10-22) |
LENGTH |
โ (ISO adds it) | โ | โ |
HIGH |
โ | โ | โ
/ ๐ (HIGH of a string CONST still missing) |
TSIZE/SIZE/ADR |
โ | โ | โ |
SHIFT/ROTATE |
โ ๏ธ implementation SYSTEM extension | โ | โ |
TBITSIZE |
โ | โ | โ |
ISO exceptions (EXCEPT, RETRY, EXCEPTIONS) |
โ | โ | โ |
Module finalization (FINALLY) |
โ | โ | โ |
__FILE__ / __LINE__ / __FUNCTION__ |
โ | โ | โ / โ / โ |
__BUILTIN__ / __ATTRIBUTE__ pragmas |
โ | โ | โ (parsed, ignored) |
Inline ASM |
โ | โ | โ |
| Feature | PIM4 | GNU Modula-2 | V3 |
|---|---|---|---|
| Definition / implementation / program modules | โ | โ | โ |
| Local modules | โ | โ | โ |
| Separate compilation | โ | โ (object files/archives) | ๐ one invocation compiles all units into one image; no incremental objects |
| Generics | โ | โ | โ |
| Object orientation | โ | โ | ๐ Clarion-form CLASS (single inheritance, virtual dispatch), not ISO 10514-3 |
PIM coroutines (PROCESS, NEWPROCESS, TRANSFER, IOTRANSFER) |
โ | โ | โ
(IOTRANSFER degrades to a transfer) |
ISO COROUTINES module |
โ | โ | โ (PIM interface only) |
| Standard library | โ (none defined) | โ PIM + ISO libraries | ๐ subset: ISO/PIM I/O, strings, storage, SysClock; no ISO exceptions/termination libs |
| Self-hosting | n/a | โ (part of GCC) | โ (byte-identical 3-stage fixpoint) |
| Backend / target | n/a | GCC (many targets) | QBE โ C (amd64 SysV today) |
PACKEDSET/generics, no standard library,
no sized SYSTEM types or address arithmetic.PACKEDSET, multi-dimensional open
arrays, sized SYSTEM types, address arithmetic, absolute variables,
ASM, pragmas, and many extensions โ but deliberately permissive
(multi-pass resolution accepts forward references).CHAR), and documents its chosen gm2
compatibility (__FILE__/__LINE__, scalarโARRAY OF BYTE, same-size
VAR, bare proc values, variant extensions, set CASE labels, libc
prototypes). Its hard gaps are the large ISO features (exceptions,
complex arithmetic, PACKEDSET, finalization/protection,
multi-dimensional open arrays, ISO OO) and its 32-bit word model
(BYTE granularity, SHORTREAL, REAL width), plus a 65536-bit
set span limit.FORWARD.INTEGER/CARDINAL/WORD/BYTE are 32-bit;
LONGINT/LONGCARD are 64-bit; every REAL/SHORTREAL is 8 bytes;
COMPLEX* is a placeholder. ARRAY OF BYTE is a compatibility
descriptor, not an 8-bit buffer.SET OF CARDINAL.CLASS dialect (single inheritance,
virtual dispatch), not ISO 10514-3.docs/STATUS.md, docs/features.md, docs/gaps/README.md,
docs/analysis_gaps.md, docs/summary_session-2026-10-22.md; the
gates in this document were run at v3-proc-types.gm2-libs/gm2-libs-iso
definition modules in the sibling gcc-git tree.