Tcl demo

Builds the Tcl 8.6.18 interpreter (tclsh) with badc and runs the upstream Tcl test suite. The suite exercises the bytecode engine, the expression compiler, string and binary scanning, and the clock/timezone code.

Layout

POSIX only: the build runs configure and make. Linux is the supported host.

Running

python3 demos/tcl/setup.py     # once, to fetch the source
python3 demos/tcl/smoke.py -v  # build + run the suite

cargo build --release --features full must have produced target/release/badc first.

A few tests race a timer against the host’s scheduler (TIMED in smoke.py), so a loaded host decides them whatever compiled tclsh. BADC_TCL_TESTS=untimed runs the suite without them and BADC_TCL_TESTS=timed runs only them, reusing a tclsh built after the current badc binary; the gate’s demo phase runs the first in its pool and the second once the pool has drained.

Version

The pin is the newest 8.6 release. TODO: Tcl 9.1.0 does not build with badc. generic/tclBasic.c calls logb, lgamma and remquo, which the bundled <math.h> does not declare. On Linux unix/tclEpollNotfy.c includes <sys/queue.h>, which is not bundled, and calls timersub, which the bundled <sys/time.h> lacks. On macOS unix/tclUnixFCmd.c reads a file’s on-disk name through attrreference_t, ATTR_CMN_NAME and FSOPT_NOFOLLOW, which the bundled <sys/attr.h> lacks, and socket -reuseport needs SO_REUSEPORT, which the bundled <sys/socket.h> defines for Linux only. With those supplied by a header included ahead of every unit, the Linux suite passes. Moving to 9.x also needs make tclUuid.h before the compile lines are replayed (tclEvent.c includes it), and its fileSystem-11 to -13 tests expect a case-insensitive volume on macOS: on a case-sensitive one the host-cc build fails them as well.

^ To the top