Modern Tcl for the AI era.
Nearly twice as fast as tclsh. Safe by default, and each script ships as one file.
1.0.0-beta.5 · BSD-2-Clause · Zig 0.17
ztcl in your browser. No files, network, or clock.
Each command can use 10,000,000 compute units.
%
What will you make?
Scripts and command-line tools
Write it, run it, and ship it as one file for Linux, macOS, or Windows, no install needed.
A safe place for other people's code
Scripts get no files, network, or programs unless you say so, and they stop at the limits you set.
A scripting language for your app
Give your users plugins and automation, from Zig, C, or JavaScript.
Numbers and AI
Tensors are built in: matrix math, all the way to running a small language model.
Coming from tclsh
Most Tcl 8.6 scripts run as they are, and Tcl 9.1 is the default.
How it works
The Tcl you know, on a new engine.
It's a fresh Tcl interpreter written in Zig, with a JIT for the hot paths. Most scripts run unchanged, and they run fast.
Nothing touches your files, network, or programs until you allow it. Every script counts its work and its memory, and stops at its limit.
TLS, HTTP/2, JSON, PDF, and tensors come built in, so your whole program fits in one static file. Take the tour.
AI agents write the code, the tests, and the docs of this project, on purpose. A person sets the direction. Why
Fast, small, and strict.
Speed
| 1.8× | Speed against tclsh 8.6.16 The median of 9 real tasks. Performance |
|---|---|
| 9 of 9 | Real tasks faster than tclsh 8.6.16 Up to 10.5 times, on CSV with the same script |
| 6 of 11 | Real tasks faster than Python 3.14 JSON 2.0 times, the HTTP server 4.0 times |
| 88.9 ms | Recursive fib(30) with the JIT 160 ms with no JIT. The JIT |
Compatibility
| 38,801 | Tests of the Tcl 8.6.16 suite that pass Of 47,133 tests in all 152 files |
|---|---|
| 12,538 | Tests of the 37 core files of Tcl 9.1.0 that pass Tcl 9.1 by default, Tcl 8.6 with --tcl 8.6 . Tcl 9.1 and 8.6 |
Sandbox
| 0 | Host access of a new interpreter No file, socket, process, clock, or environment. Security model |
|---|---|
| 4 | Limits on each script Compute, memory, nesting, and native stack. Limits |
| 9.6 ms | Start of a thread in its own microVM On KVM. A snapshot restores in 0.42 ms. Isolated threads |
Size and start
| 0.63 ms | Start of a script with one puts tclsh 8.6.16: 2.17 ms |
|---|---|
| 5.2 MB | The runner, stripped, with all modules 2.1 MB with gzip. It links no library |
| 508 KB | ztcl.wasm with gzip 1.49 MB with no compression |
| 1.24 MB | Hello world from ztcl build --strip One static binary. Build a program |
Platforms
| 6 | Native targets Linux, macOS, and Windows, on x86-64 and arm64. Targets |
|---|---|
| wasm | The browser and Node.js npm install @beetlebug/ztcl |
Intel Core i7-6700K, Linux, 2026-11-29, the median of 15 runs. Each number is in the page that its row links.
Install ztcl.
Install has the release archives and the build from source.
A JIT, and one static binary for your program.
The JIT compiles bytecode to machine code on x86-64 and arm64. ztcl is faster than tclsh 8.6.16 on each of 9 real tasks, 1.8 times at the median.
Real tasks spend most of their time in built-in commands. The JIT cuts recursive fib(30) from 160 ms to 88.9 ms.
ztcl build puts the runtime and your scripts in one static binary for Linux, macOS, or Windows.
Performance · The JIT · Build a program · bench/compare
Tcl in the browser, and WebAssembly in Tcl.
npm install @beetlebug/ztcl gives a 508 KB module with the same limits, dom for the page, and web:: for Bluetooth, USB, serial, and MIDI.
ztcl compile --wasm makes a module with a WebAssembly function for each proc of a script.
ztcl::wasm runs WebAssembly with its own JIT, and passes the full core spec suite.
Playground · WebAssembly · ztcl::wasm
On ztk: a window from an app in Rust, Go, or JavaScript.

Run code that you did not write.
A new interpreter has no files, sockets, processes, clock, or environment. The embedder turns on each capability by name.
The compute limit, the memory limit, and the nesting limits stop a script at the same point on each machine.
A thread runs in the same process, in the sandbox of the system, or in a Linux microVM that starts in 9.6 ms. A program of exec has the full power of the user.
Security model · Limits and capabilities · Isolated threads · Sandboxed agents

Comprehensive standard library
TLS, HTTP/2, JSON, PDF, and tensors, with no C library.
ztcl::tls is a TLS 1.3 client in Zig. The HTTP/2 server engine passes h2spec 2.6.0, 146 of 146.
ztcl::json parses twitter.json at 1,180 MB/s. ztcl::pdf and ztcl::typeset write documents.
ztcl::tensor has typed arrays of numbers, and runs the 15M model of llama2.c.
TLS 1.3 · ztcl::json · PDF · ztcl::tensor · Modules

Tk and phones
Windows and phone apps on ztk.
ztk is Tk in Zig, on ztcl. It draws with the GPU on each platform, and styles each widget with CSS.
The same Tk script runs as a native app on Linux, macOS, Windows, the web, iOS, and Android.
An app in any language that compiles to WebAssembly opens ztk windows and native phone screens.
Projects, a debugger, and embedding.
- Projects. ztcl init writes a project with its code, its tests, and its project file. ztcl run runs it, and ztcl test runs its tests with no capability.
- Debugging. ztcl debug explains an error, records and replays a run, is a DAP debugger for your editor, and serves MCP tools to an agent. Probes record values in a running script, also at a stop at the compute limit or the memory limit. ztcl::disasm shows why a proc is slow. The page has a worked example for each tool.
- Embedding. zig fetch adds ztcl to a Zig program. libztcl builds C programs and Tcl extensions against ztcl as libtcl8.6.
- One binary. ztcl build --strip keeps only the commands that the scripts use: hello world is 1,236,273 bytes.
Compatibility
Tcl 9.1 by default, Tcl 8.6 on request.
38,801 tests of the Tcl 8.6.16 suite and 12,538 tests of the Tcl 9.1.0 core files pass. The JIT gives the same output as the interpreter. With libztcl, the unchanged tclsh8.6 runs on ztcl. Tcl 9.1 and Tcl 8.6.
100% AI-driven, on purpose
AI agents write the code, the tests, and the docs. A person sets the direction.
The project tests how far a project can go when its agents move as fast as they can. An optimization that was too much work before is a 15-minute change now, so the project tries each one.
Tcl was a language for people to learn. ztcl is a Tcl for agents.
Beta: 1.0.0-beta.5. APIs can change before 1.0.0. AI coding agents wrote the code and the docs, under human direction, so review the code before you depend on it. The issues and the milestones have the roadmap.