FAQ

Is ztcl a drop-in replacement for Tcl?

Not yet. ztcl passes 38,054 of the 47,133 tests of the Tcl 8.6.16 suite. Most scripts that use the core commands run unchanged. The language lists the differences. C extensions and Tk are out of scope. For a Tk replacement on ztcl, see ztk.

Does it support Tcl 9?

Yes. ztcl follows Tcl 9.1 by default: the new list commands, strict encodings, decimal numbers with a leading zero, and variable lookup in namespaces. ztcl --tcl 8.6 follows Tcl 8.6, for a script that needs its behavior. Tcl 9.1 and Tcl 8.6 has the differences, the parts of 9.1 that are not done yet, and each way to choose 8.6.

Why is open an invalid command?

A script has no host access by default. Turn on the capabilities that the script needs, for example ztcl --allow channels,file --root DIR script.tcl. See Limits and capabilities.

Is it safe to run scripts from untrusted users?

That is the main use of ztcl. Set a compute limit and a memory limit, and turn on only the capabilities that you need. Never turn on exec for untrusted scripts: it is not sandboxed. Security has the threat model and how to report a problem.

Which platforms does it run on?

Linux and macOS on x86-64 and arm64, Windows on x86-64, and WebAssembly in browsers and Node.js. The JIT runs on x86-64 Linux, x86-64 Windows, arm64 Linux, and arm64 macOS. Coroutines need a stack switch, which exists for x86-64 Linux, arm64 Linux, arm64 macOS, and x86-64 Windows.

Is the JIT on by default?

Yes, where the build and the system have it. Turn it off with --no-jit, ZTCL_JIT=off, or Interp.disableJit. See The JIT.

Can I load C extensions?

No. Add native commands from Zig with Interp.register. See Embed in Zig.

Who wrote ztcl?

ztcl is a project of beetlebug, built for the zslice slicer. The code and the docs were written largely with AI coding agents, under human direction. Review the code before you depend on it.

Where is the roadmap?

The issues and the milestones on GitHub. Contributors find the plans and the task lists in docs/dev/.