r/Tcl • u/Whole-Sherbet3576 • 1h ago
Modern Tcl for the AI era.
I've always really enjoyed Tcl as a language. I cut my teeth on its C code which is some of the best I've ever seen. I couldn't keep using it in my career but with AI was finally able to build something for myself. The Tcl/Tk that I wanted to see.
Tcl with JIT, AOT, and WASM compilation (~1.8x faster on common stuff, up to 50x for math and tight loops), microVM threads, tensor math modules, deep mobile integration, WASM host (run zig/rust/go/etc inside ztcl/ztk).
For Tk it's completely GPU based, and works on the web. Styled with CSS. A new Flexbox layout engine. A nice terminal widget thanks to ghostty. Full mobile complement (native UI) for iOS and Android with super easy build process. Even includes all the web apis so you can build for the web with Tcl.
Written in Zig with only ghostty and libwebp/libpng as dependencies.
Compiled binaries start under 10mb.
I'd love feedback. I plan to integrate this into my other projects soon (zslice and lookout marine). I'm going to rewrite them in this. I originally started this as a simple Tcl like language to embed in zslice but now that it has full Tk I can actually implement them in it now.
Here is an example UI showing how you can isolate mv threads and monitor their traffic. Written in ztk.

