|
@@ -1,7 +1,7 @@
|
|
|
# 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-finally` (suite
|
|
|
|
|
-283/283, self-hosting fixpoint OK 4,198,600 bytes, corpus 512/612,
|
|
|
|
|
|
|
+**Date:** 2026-10-23 · **V3 state:** `v3-open-arrays-m4` (suite
|
|
|
|
|
+295/295, self-hosting fixpoint OK 3,480,366 bytes, corpus 518/612,
|
|
|
0 crashes).
|
|
0 crashes).
|
|
|
|
|
|
|
|
**Scope and sources.**
|
|
**Scope and sources.**
|
|
@@ -75,7 +75,7 @@ change individual cells.
|
|
|
| `PACKEDSET` | ❌ (ISO) | ✅ | ❌ | ❌ | ✅ (1/2/4 bytes, span ≤ 32) |
|
|
| `PACKEDSET` | ❌ (ISO) | ✅ | ❌ | ❌ | ✅ (1/2/4 bytes, span ≤ 32) |
|
|
|
| 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 | ❌ | ✅ (flat payload + per-level views; legacy 1-D ABI adapter) |
|
|
|
| Records | ✅ | ✅ | ✅ extensible | ✅ | ✅ (incl. self-referential pointer fields) |
|
|
| 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) | ✅ | ✅ (incl. chained `p^.next^.value`) |
|
|
| Pointers, `NIL`, opaque types | ✅ | ✅ | ✅ (`OPAQUE` keyword) | ✅ | ✅ (incl. chained `p^.next^.value`) |
|
|
@@ -99,7 +99,7 @@ change individual cells.
|
|
|
| Empty string `""`/`''` as `CHAR` | ❌/unclear (ISO rule) | ✅ | 🔄 (char literals compatible with `ARRAY OF CHAR`; empty-to-`CHAR` not explicit) | ✅ | ✅ (ISO rule) |
|
|
| Empty string `""`/`''` as `CHAR` | ❌/unclear (ISO rule) | ✅ | 🔄 (char literals compatible with `ARRAY OF CHAR`; empty-to-`CHAR` not explicit) | ✅ | ✅ (ISO rule) |
|
|
|
| `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 | ✅ | ✅ array payload `SIZE`; multi/open `ADR` = payload base; fixed 1-D `ADR` keeps descriptor compatibility |
|
|
|
| Runtime subrange range checks | ⚠️ error per language; checks implementation-defined | ✅ | ✅ (R10 safety) | 🔄 | ✅ assignment/value actual/`RETURN`/`INC`/`DEC`; catchable `rangeException`; `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` | ❌ | ✅ | ❌ | ❌ | ❌ |
|
|
@@ -154,12 +154,14 @@ change individual cells.
|
|
|
extensions, set `CASE` labels, libc prototypes). ISO exceptions are
|
|
extensions, set `CASE` labels, libc prototypes). ISO exceptions are
|
|
|
**mostly complete** (`EXCEPT`/`RETRY`/`SYSTEM.THROW`, `EXCEPTIONS`/
|
|
**mostly complete** (`EXCEPT`/`RETRY`/`SYSTEM.THROW`, `EXCEPTIONS`/
|
|
|
`M2EXCEPTION`, index/range/CASE/function traps, and module
|
|
`M2EXCEPTION`, index/range/CASE/function traps, and module
|
|
|
- `FINALLY`). Its hard gaps are **complex arithmetic,
|
|
|
|
|
- finalization/protection, multi-dimensional open arrays, ISO OO** and
|
|
|
|
|
- parts of the **word model** (`SHORTREAL`, `REAL` width), plus a
|
|
|
|
|
- **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.
|
|
|
|
|
|
|
+ `FINALLY`). Fixed and open multi-dimensional arrays use a flat
|
|
|
|
|
+ payload with per-level views; payload `SIZE`/`ADR` and row/subarray
|
|
|
|
|
+ conversion are implemented. Its hard gaps are **complex arithmetic,
|
|
|
|
|
+ finalization/protection, ISO OO** and parts of the **word model**
|
|
|
|
|
+ (`SHORTREAL`, `REAL` width), plus a **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
|
|
|
|
|
|
|
@@ -183,9 +185,11 @@ change individual cells.
|
|
|
- **Module `FINALLY`** runs on normal `main` return in reverse
|
|
- **Module `FINALLY`** runs on normal `main` return in reverse
|
|
|
initialization order. `HALT`, unhandled aborts and the ISO
|
|
initialization order. `HALT`, unhandled aborts and the ISO
|
|
|
`TERMINATION` module are not covered.
|
|
`TERMINATION` module are not covered.
|
|
|
-- **Multi-dimensional open arrays** are not supported: V3 represents an
|
|
|
|
|
- array level as its own descriptor, whereas gm2 passes a flat block —
|
|
|
|
|
- accepting the corpus files would compile but miscompile.
|
|
|
|
|
|
|
+- **Multi-dimensional arrays** use a flat payload and per-level
|
|
|
|
|
+ 40-byte views. A legacy 1-D `{count,data}` descriptor is still used
|
|
|
|
|
+ at ABI boundaries; row/`ARRAY OF BYTE` conversions are copy-based
|
|
|
|
|
+ there, so row `ADR` identity through an internal 1-D call remains a
|
|
|
|
|
+ follow-up.
|
|
|
- **Single-invocation compilation:** definition, implementation and
|
|
- **Single-invocation compilation:** definition, implementation and
|
|
|
program units are compiled together into one image; there is no
|
|
program units are compiled together into one image; there is no
|
|
|
incremental object/archive format.
|
|
incremental object/archive format.
|
|
@@ -195,8 +199,9 @@ 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-exceptions.md`; the
|
|
|
|
|
- gates in this document were run at `v3-finally`.
|
|
|
|
|
|
|
+ `docs/analysis_gaps.md`,
|
|
|
|
|
+ `docs/summary_session-2026-10-23-open-arrays.md`; the gates in this
|
|
|
|
|
+ document were run at `v3-open-arrays-m4`.
|
|
|
- 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
|