|
| 1 | +# MeTTaScript 2.1.0 |
| 2 | + |
| 3 | +Imports are now transitive, deduplicated, and cycle-safe. A module you import can itself import other |
| 4 | +modules, and their definitions become available; importing the same module twice is a no-op; and a cycle of |
| 5 | +imports resolves instead of failing. Import order already did not matter. Every terminating program from |
| 6 | +2.0.4 produces the same output, validated byte-identical across the full corpus, so upgrading is safe. |
| 7 | + |
| 8 | +## Transitive, deduplicated, cycle-safe imports |
| 9 | + |
| 10 | +Before this release, `(import! &self <module>)` brought in only that module's own definitions. If the module |
| 11 | +itself imported another, those transitive definitions did not follow; importing the same module twice |
| 12 | +duplicated its rules; and a cycle of imports left calls unresolved. |
| 13 | + |
| 14 | +Now `import!` resolves the whole definition closure. When you import a module, its definitions load, and so |
| 15 | +do the definitions of every module it imports, transitively. Each module loads once per space, so a |
| 16 | +duplicate import is a no-op and a cycle of imports terminates. This matches Hyperon on transitivity and |
| 17 | +deduplication, and it is cycle-safe where Hyperon loops, which affects no terminating program. |
| 18 | + |
| 19 | +The model stays definition-oriented. Importing a module brings its definitions and follows its `import!` |
| 20 | +edges, but does not execute the module's other top-level `!` directives, so a module's own tests or prints |
| 21 | +do not re-run when you import it. |
| 22 | + |
| 23 | +## Compatibility |
| 24 | + |
| 25 | +Nothing changes for programs that do not use nested, duplicate, or cyclic imports, which is the whole |
| 26 | +existing corpus: 124 of 124 programs are byte-identical to 2.0.4. The new behavior only activates for the |
| 27 | +import shapes that previously did not work. |
| 28 | + |
1 | 29 | # MeTTaScript 2.0.4 |
2 | 30 |
|
3 | 31 | A packaging fix for the browser compatibility package. `@metta-ts/browser` declared `sideEffects: false` |
|
0 commit comments