Skip to content

Commit 18c7dab

Browse files
committed
MeTTaScript 2.4.0
1 parent 9c7fc85 commit 18c7dab

29 files changed

Lines changed: 1372 additions & 117 deletions

File tree

RELEASE_NOTES.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
# MeTTaScript 2.4.0
2+
3+
A native fast path for the functions that destructure data. A deterministic function that matches on its
4+
argument's constructor — an evaluator over an expression tree, a symbolic transformer like differentiation,
5+
an environment lookup — now compiles to a native switch on the constructor that returns its result
6+
directly, instead of rebuilding an intermediate atom at every step for the evaluator to re-reduce. Removing
7+
that per-step allocation is the win. Every terminating program produces the same output as 2.3.1, validated
8+
byte-identical across the full corpus, so upgrading is safe.
9+
10+
## Native scalar dispatch
11+
12+
When a function's clauses are mutually exclusive on their head constructor and its bodies stay within
13+
arithmetic, constructor construction, and recursive calls over the destructured children, the whole function
14+
compiles to native code: it dispatches on the argument's constructor, binds the children, evaluates the body
15+
with native arithmetic and direct recursive calls, and returns a bare value or a directly built atom — no
16+
result bag, no per-node atom allocation, no round trip back through the evaluator. Clauses outside that
17+
subset, non-ground calls, and any runtime rule change fall back to the interpreter, and the compiled and
18+
fallback clauses are proven pairwise exclusive so the direct return is sound.
19+
20+
Integer, floating-point, atom-returning, and mixed-return functions are all covered, with `3` and `3.0` kept
21+
distinct and the interpreter's numeric coercion matched exactly. The compiled recursion shares the same
22+
evaluation-depth accounting as the interpreter, so a deep computation cuts at the `max-stack-depth` bound at
23+
exactly the same place with the same `StackOverflow`, and runs native the whole way through a raised bound.
24+
25+
On an interpreter over a large expression tree the evaluation runs 3 to 5 times faster and holds 25 to 40
26+
percent less heap; a symbolic differentiation at a raised depth bound runs about 2.2 times faster with 40
27+
percent less peak memory. Output stays byte-identical in every case.
28+
29+
## Docs
30+
31+
The site description now matches the rest of the positioning: a metagraph database and reasoning engine you
32+
drive from TypeScript, not only a query store.
33+
134
# MeTTaScript 2.3.1
235

336
A patch fix for the native-stack recovery path added in 2.3.0. When a very deep structural comparison

compat/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/browser",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/core",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/das-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/das-client",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/das-gateway/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/das-gateway",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/debug/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/debug",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/edsl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/edsl",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/grapher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/grapher",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/hyperon/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/hyperon",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/libraries/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/libraries",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

0 commit comments

Comments
 (0)