From Newsgroup: comp.lang.tcl
Hello everyone,
I am pleased to announce the release of TBCX v1.1.
TBCX is a C extension for Tcl 9.1+ that serializes compiled Tcl bytecode
(plus enough metadata to reconstruct procs, TclOO methods, and lambda constructs) into a compact binary file — and later allows to load that
file into another interpreter for fast startup without re-parsing or re-compiling the original source. There's also a disassembler for human-readable inspection.
What's New in v1.1:
Breaking: The on-disk format changed from 9 to 91. Artifacts from
v1.0 are not loadable by v1.1 and vice versa.
Instruction-level body detection — a two-phase bytecode scanner now
finds and precompiles script bodies that v1.0 left as plain text.
This covers bodies for eval, uplevel, try/on/trap/finally, catch,
foreach, while, for, if, dict for/map/update/with, lmap, time,
timerate, and self method. Uses an O(1) opcode dispatch table.
startCommand stripping — debugging instructions (~15% of bytecode)
are replaced with jump1 at save time, reducing execution overhead
while preserving all offsets.
Self methods — oo::define { self method ... } is now captured and
precompiled (kind 4), preserving metaclass inheritance for subclasses.
oo::objdefine — per-object method definitions are now supported.
unexport preservation — method access flags survive the body-swap
during class precompilation.
Cross-interpreter support — new TBCX_LIT_BYTESRC literal bundles
bytecode with source text, enabling graceful recompilation in child
interpreters or after epoch bumps.
Lambda shimmer recovery — a persistent per-interpreter ApplyShim
re-installs precompiled lambdas if type shimmer evicts them.
NRE-aware shims — ProcShim and OOShim now intercept both objProc2
and nreProc2 dispatch paths for full compatibility with Tcl's
non-recursive evaluation engine.
Hardened deserialization — tightened wire-format limits (code: 1 GiB
-> 64 MiB, literals: 64M -> 1M, strings: 16 MiB -> 4 MiB), plus
new caps for locals, stack depth, procs, classes, and methods.
All wire-derived allocations use Tcl_AttemptAlloc.
Test suite — grew from 32 to 536 unit tests across 28 files, plus
342 assertions in a comprehensive roundtrip test.
Compatibility:
This package supports only Tcl 9.1, and it's been tested with Tcl 9.1a2.
For previous versions you may want to use
-
https://github.com/tcltk-depot/tclcompiler
-
https://github.com/tcltk-depot/tbcload
Project Homepage:
https://github.com/bagnongithub/tbcx
Documentation:
https://bagnongithub.github.io/tbcx
License:
MIT License
Feedback/Bug Reports:
Feedback is welcome on the issue tracker
https://github.com/bagnongithub/tbcx/issues
--- Synchronet 3.21f-Linux NewsLink 1.2