|
@@ -1,6 +1,6 @@
|
|
|
# PIM4 vs GNU Modula-2 vs M2R10 vs TopSpeed V3 vs V3 — feature comparison
|
|
# PIM4 vs GNU Modula-2 vs M2R10 vs TopSpeed V3 vs V3 — feature comparison
|
|
|
|
|
|
|
|
-**Date:** 2026-10-23 · **V3 state:** `v3-packedset` (suite
|
|
|
|
|
|
|
+**Date:** 2026-10-23 · **V3 state:** `v3-ptrchain` (suite
|
|
|
276/276, self-hosting fixpoint OK 4,143,847 bytes, corpus 512/612,
|
|
276/276, self-hosting fixpoint OK 4,143,847 bytes, corpus 512/612,
|
|
|
0 crashes).
|
|
0 crashes).
|
|
|
|
|
|
|
@@ -76,9 +76,9 @@ change individual cells.
|
|
|
| Fixed / multi-dimensional arrays | ✅ `[a], [b] OF` | ✅ | ✅ `ARRAY count, count OF` (zero-based) | ✅ | ✅ both `[a], [b]` and `[a, b]` |
|
|
| Fixed / multi-dimensional arrays | ✅ `[a], [b] OF` | ✅ | ✅ `ARRAY count, count OF` (zero-based) | ✅ | ✅ both `[a], [b]` and `[a, b]` |
|
|
|
| Open arrays (1-D) | ✅ | ✅ | ✅ (`BARE ARRAY OF`) | ✅ | ✅ |
|
|
| Open arrays (1-D) | ✅ | ✅ | ✅ (`BARE ARRAY OF`) | ✅ | ✅ |
|
|
|
| Multi-dimensional open arrays | ❌ (ISO addition) | ✅ | 🔄 one-dimensional `BARE` arrays | ❌ | ❌ (descriptor-per-level representation) |
|
|
| Multi-dimensional open arrays | ❌ (ISO addition) | ✅ | 🔄 one-dimensional `BARE` arrays | ❌ | ❌ (descriptor-per-level representation) |
|
|
|
-| Records | ✅ | ✅ | ✅ extensible | ✅ | ✅ |
|
|
|
|
|
|
|
+| Records | ✅ | ✅ | ✅ extensible | ✅ | ✅ (incl. self-referential pointer fields) |
|
|
|
| Variant records | ✅ | ✅ | ❌ removed (extensible records replace them) | ✅ | ✅ (plus empty arms/`ELSE`) |
|
|
| Variant records | ✅ | ✅ | ❌ removed (extensible records replace them) | ✅ | ✅ (plus empty arms/`ELSE`) |
|
|
|
-| Pointers, `NIL`, opaque types | ✅ | ✅ | ✅ (`OPAQUE` keyword) | ✅ | ✅ |
|
|
|
|
|
|
|
+| Pointers, `NIL`, opaque types | ✅ | ✅ | ✅ (`OPAQUE` keyword) | ✅ | ✅ (incl. chained `p^.next^.value`) |
|
|
|
| Procedure types | ✅ (`PROCEDURE`) | ✅ (`PROCEDURE`, `PROC`) | ✅ (comma-separated formals) | ✅ | ✅ (`PROCEDURE`, `PROC`; comma/unnamed forms) |
|
|
| Procedure types | ✅ (`PROCEDURE`) | ✅ (`PROCEDURE`, `PROC`) | ✅ (comma-separated formals) | ✅ | ✅ (`PROCEDURE`, `PROC`; comma/unnamed forms) |
|
|
|
| Complex types (`COMPLEX`, `LONGCOMPLEX`) | ❌ | ✅ (ISO) | ❌ (not in the base R10 grammar) | ❌ | ❌ (`COMPLEX64` is a `REAL` placeholder) |
|
|
| Complex types (`COMPLEX`, `LONGCOMPLEX`) | ❌ | ✅ (ISO) | ❌ (not in the base R10 grammar) | ❌ | ❌ (`COMPLEX64` is a `REAL` placeholder) |
|
|
|
| SYSTEM sized types (`WORD32`, `CARDINAL8`, `BITSET32`, …) | ❌ | ✅ | 🔄 `OCTET` (8-bit), `LONGCARD`, `LONGBITSET` | 🔄 `SHORTINT`/`LONGINT`/`SHORTCARD`/`LONGCARD` family | ✅ 8/16/32 names; `WORD`/`WORD32` 32-bit |
|
|
| SYSTEM sized types (`WORD32`, `CARDINAL8`, `BITSET32`, …) | ❌ | ✅ | 🔄 `OCTET` (8-bit), `LONGCARD`, `LONGBITSET` | 🔄 `SHORTINT`/`LONGINT`/`SHORTCARD`/`LONGCARD` family | ✅ 8/16/32 names; `WORD`/`WORD32` 32-bit |
|
|
@@ -100,7 +100,7 @@ change individual cells.
|
|
|
| `LENGTH` | ❌ (ISO adds it) | ✅ | 🔄 library/pervasive, not in the base grammar | ❌ | ✅ |
|
|
| `LENGTH` | ❌ (ISO adds it) | ✅ | 🔄 library/pervasive, not in the base grammar | ❌ | ✅ |
|
|
|
| `HIGH` | ✅ | ✅ | ❌ (not in the R10 grammar) | ✅ | ✅ (including string `CONST`) |
|
|
| `HIGH` | ✅ | ✅ | ❌ (not in the R10 grammar) | ✅ | ✅ (including string `CONST`) |
|
|
|
| `TSIZE`/`SIZE`/`ADR` | ✅ | ✅ | 🔄 SYSTEM/library forms | ✅ | ✅ |
|
|
| `TSIZE`/`SIZE`/`ADR` | ✅ | ✅ | 🔄 SYSTEM/library forms | ✅ | ✅ |
|
|
|
-| Runtime subrange range checks | ⚠️ error per language; checks implementation-defined | ✅ | ✅ (R10 safety) | 🔄 | ✅ assignment/value actual/`RETURN`/`INC`/`DEC`; `FOR` final increment exempt |
|
|
|
|
|
|
|
+| Runtime subrange range checks | ⚠️ error per language; checks implementation-defined | ✅ | ✅ (R10 safety) | 🔄 | ✅ assignment/value actual/`RETURN`/`INC`/`DEC`; catchable `rangeException`; `FOR` final increment exempt |
|
|
|
| `SHIFT`/`ROTATE` | ⚠️ implementation SYSTEM extension | ✅ | ❌ | ✅ (`<<`/`>>` operators) | ✅ |
|
|
| `SHIFT`/`ROTATE` | ⚠️ implementation SYSTEM extension | ✅ | ❌ | ✅ (`<<`/`>>` operators) | ✅ |
|
|
|
| `TBITSIZE` | ❌ | ✅ | ❌ | ❌ | ❌ |
|
|
| `TBITSIZE` | ❌ | ✅ | ❌ | ❌ | ❌ |
|
|
|
| ISO exceptions (`EXCEPT`, `RETRY`, `EXCEPTIONS`) | ❌ | ✅ | ❌ (not in the base R10 grammar) | ❌ | 🔄 `EXCEPT`/`RETRY`/`SYSTEM.THROW`, `EXCEPTIONS`/`M2EXCEPTION`, index/range/CASE traps; `functionException`/`FINALLY` pending |
|
|
| ISO exceptions (`EXCEPT`, `RETRY`, `EXCEPTIONS`) | ❌ | ✅ | ❌ (not in the base R10 grammar) | ❌ | 🔄 `EXCEPT`/`RETRY`/`SYSTEM.THROW`, `EXCEPTIONS`/`M2EXCEPTION`, index/range/CASE traps; `functionException`/`FINALLY` pending |
|
|
@@ -158,6 +158,8 @@ change individual cells.
|
|
|
finalization/protection, multi-dimensional open arrays, ISO OO** and
|
|
finalization/protection, multi-dimensional open arrays, ISO OO** and
|
|
|
parts of the **word model** (`SHORTREAL`, `REAL` width), plus a
|
|
parts of the **word model** (`SHORTREAL`, `REAL` width), plus a
|
|
|
**65536-bit `SET` span limit** and a **32-bit `PACKEDSET` limit**.
|
|
**65536-bit `SET` span limit** and a **32-bit `PACKEDSET` limit**.
|
|
|
|
|
+ Self-referential pointer records and chained pointer-field
|
|
|
|
|
+ designators (`p^.next^.value`) are supported.
|
|
|
|
|
|
|
|
## V3-specific deviations and limits
|
|
## V3-specific deviations and limits
|
|
|
|
|
|
|
@@ -174,9 +176,10 @@ change individual cells.
|
|
|
1/2/4-byte storage with a 32-bit span limit (wider spans are a loud
|
|
1/2/4-byte storage with a 32-bit span limit (wider spans are a loud
|
|
|
`230`).
|
|
`230`).
|
|
|
- **Runtime range checks** are emitted for subrange assignment, value
|
|
- **Runtime range checks** are emitted for subrange assignment, value
|
|
|
- actuals, `RETURN` and `INC`/`DEC` (`QbeGen.CheckRange`, abort trap).
|
|
|
|
|
- The post-increment of a `FOR` control variable is not checked: the
|
|
|
|
|
- final successor may legitimately exceed a full subrange.
|
|
|
|
|
|
|
+ actuals, `RETURN` and `INC`/`DEC` (`QbeGen.CheckRange`); they raise a
|
|
|
|
|
+ catchable `rangeException`, with an unhandled exception aborting at
|
|
|
|
|
+ rc 134. The post-increment of a `FOR` control variable is not
|
|
|
|
|
+ checked: the final successor may legitimately exceed a full subrange.
|
|
|
- **Multi-dimensional open arrays** are not supported: V3 represents an
|
|
- **Multi-dimensional open arrays** are not supported: V3 represents an
|
|
|
array level as its own descriptor, whereas gm2 passes a flat block —
|
|
array level as its own descriptor, whereas gm2 passes a flat block —
|
|
|
accepting the corpus files would compile but miscompile.
|
|
accepting the corpus files would compile but miscompile.
|
|
@@ -189,8 +192,8 @@ change individual cells.
|
|
|
## Sources
|
|
## Sources
|
|
|
|
|
|
|
|
- V3: `docs/STATUS.md`, `docs/features.md`, `docs/gaps/README.md`,
|
|
- V3: `docs/STATUS.md`, `docs/features.md`, `docs/gaps/README.md`,
|
|
|
- `docs/analysis_gaps.md`, `docs/summary_session-2026-10-23.md`; the
|
|
|
|
|
- gates in this document were run at `v3-packedset`.
|
|
|
|
|
|
|
+ `docs/analysis_gaps.md`, `docs/summary_session-2026-10-23-exceptions.md`; the
|
|
|
|
|
+ gates in this document were run at `v3-ptrchain`.
|
|
|
- gm2: the GCC Modula-2 testsuite and `gm2-libs`/`gm2-libs-iso`
|
|
- gm2: the GCC Modula-2 testsuite and `gm2-libs`/`gm2-libs-iso`
|
|
|
definition modules in the sibling `gcc-git` tree.
|
|
definition modules in the sibling `gcc-git` tree.
|
|
|
- M2R10: the published R10 grammar (m2r10-grammar.gll) and
|
|
- M2R10: the published R10 grammar (m2r10-grammar.gll) and
|