Overview
| Comment: | Tuple assignment is now compiled into a single instruction: this is version 16e. It runs twice as fast, while yielding the same results as before. The change: an assignment such as `(a, (b, c), d) = v` now uses the `tupleAssign` instruction. Previously, this involved a call to `::tcl::unsupported::content`, followed by a series of instructions for each name that wrote to the variable by looking it up via its name. Local variables: the compiler now records the position of each name within the local variable array. Consequently, the instruction writes to these variables directly, without requiring a name-based lookup. Other names: qualified names, or assignments occurring outside of a procedure, are still handled by name, just as before. Unchanged behavior: the deep content of a tuple, the use of an empty string (`""`) for missing elements, the order of assignments, traces, links, contracts, and error messages all remain the same. Details: Additional performance gain: nested lists without annotations are no longer copied during each assignment. Memory leak fixed: Valgrind detected a leak when an element was missing at an intermediate level—for example, in the case `(a, (b, c)) = {1}`. This has been resolved. Measurements (in nanoseconds per assignment): | Assignment | Before | After | |:----- | ---------:| --------:| |(a, (b, c), d) = $v| 820 | 330| | (x, y) = $p (a point) |340 | 170 | Verifications: All 65 tests pass, in both standard and compact formats. The new test, `t87`, covers the scenarios mentioned above. The output is identical to version 16b, with the exception of three tests that count the number of generated instructions (`t82`, `t83`, and `t87`). A full `make test` run shows the same 61 failures as the reference version. Following the fix for the memory leak, Valgrind reports no new issues. Regarding installation: this version adds a kernel patch, `expr-tuple.patch`. I have verified, using an up-to-date source tree, that `maj.sh` correctly identifies the 17 patches already applied and then applies the new one. Since it adds an instruction to the bytecode, a full recompilation is performed; upon completion, `maj.sh` should display "version installed: v16e". The documentation and the schedule have been updated. |
|---|---|
| Timelines: | family | ancestors | descendants | both | tip-764_tcl90 |
| Files: | files | file ages | folders |
| SHA3-256: |
28e84e2d0c307409ca4e9003e45564ac |
| User & Date: | Florentis on 2026-10-25 12:58:09.371 |
| Other Links: | branch diff | manifest | tags |
Context
|
2026-10-25
| ||
| 13:02 | I have updated `bench_cstruct.tcl` and re-run it on v16e: in compact mode, the full sequence runs 15... check-in: 23da210385 user: Florentis tags: tip-764_tcl90 | |
| 12:58 | Tuple assignment is now compiled into a single instruction: this is version 16e. It runs twice as fa... check-in: 28e84e2d0c user: Florentis tags: tip-764_tcl90 | |
| 12:21 | I have implemented the three points, delivered in v16d. The C codec now covers calculated sizes and ... check-in: 1a6fc7a4f8 user: Florentis tags: tip-764_tcl90 | |
Changes
Modified generic/tclCompExpr.c
from [bd0d196849]
to [9fd47ace57].
[diff]
Modified generic/tclCompile.c
from [611bc94258]
to [dee1f5e216].
[diff]
Modified generic/tclCompile.h
from [ba4b448112]
to [53742929ad].
[diff]
Modified generic/tclExecute.c
from [2609f6909f]
to [c559701de9].
[diff]
Modified generic/tclTypes.c
from [35d06ae1e1]
to [3b28a9e417].
[diff]
Modified generic/tclTypes.h
from [edbc8369dc]
to [9fefbfb43c].
[diff]
Modified typeparse/REPRISE.md
from [9595efbda8]
to [e02fb558dc].
[diff]
Modified typeparse/VERSION
from [2e8a2e7ba4]
to [718caaf4dd].
[diff]
Modified typeparse/noyau/LISEZMOI.md
from [b6c31f02a7]
to [3780dcda78].
[diff]
Modified typeparse/noyau/ORDRE.txt
from [162cea6cfd]
to [15b4a00c1f].
[diff]
Added typeparse/noyau/expr-tuple.patch version [a4fece9b6f].
Modified typeparse/tclTypes.c
from [83c492b15b]
to [3b28a9e417].
[diff]
Modified typeparse/tclTypes.h
from [8bc11989e7]
to [9fefbfb43c].
[diff]
Added typeparse/tests_tclsh/t87_tuple_bytecode.out version [7157dfd57c].
Added typeparse/tests_tclsh/t87_tuple_bytecode.tcl version [78893ff39e].