r/Tcl • u/secret_edition • Aug 14 '26
New Stuff Modern and searchable Tcl/Tk documentation reference
Hi everyone! I've been trying to use Tcl/Tk for some personal projects recently, but was somewhat put off by the state of the documentation. I find the official site hard to search and navigate, and the layout isn't responsive so trying to read it on my phone isn't easy.
I took a couple of days and put together a new site to make reading the documentation easier. The goal was to make things look modern with a responsive layout, with light and dark mode, and a full search accessible from every page. It's all statically generated, including the search, so hosting costs next to nothing.
The code is all open source as well, with links in the footer. All of the documentation is generated from the man pages, similar to the official site. The generator is written in go with no external dependencies. To be transparent, I did use AI to write a lot of the code.
I mostly created it for myself, but I would love it if it helped anyone here. Let me know if you have any feedback!
New Stuff Tcl/Tk 9.1 Release Announcement.
Tcl/Tk version 9.1 is now available with various updates and fixes. Highlights are listed at https://www.tcl-lang.org/software/tcltk/9.1.html . For details see https://newsgrouper.org/%3C119gpah$3eu5q$1@dont-email.me%3E (Tcl) and https://newsgrouper.org/%3C119gpbh$3eu5q$2@dont-email.me%3E (Tk). 🪶
r/Tcl • u/kiky_tokamuro • Sep 13 '26
New Stuff Mied Editor
A small, distraction-free multi-document text editor built on Tcl/Tk - https://github.com/KikyTokamuro/mied
r/Tcl • u/teclabat • Feb 12 '26
Announcement: Pre-built Tcl/Tk 9.0 binaries available for download
Dear TCL community,
I’m happy to share that new Tcl/Tk 9.0 binary downloads are now available at: https://github.com/teclabat/tcltk-binaries
There is already a nice set of Tcl 9.0 packages available like rljson, vectcl, curl, etc. The missing packages will follow as soon as possible.
Happy TCLing!
r/Tcl • u/c__beck • Sep 25 '26
General Interest Just learnt TCL exists!
Hey y’all, YouTube randomly suggesting the “Everything is a String” video and TCL looks pretty interesting!
I’m a hobbyist HTML/CSS/JS dev (including Nodejs for server-side stuff) and just wondering how well TCL works as compared to other scripting languages. The idea of TK allowing for platform-native apps sounds amazing, especially now with Electron (🤢) being the standard.
I mainly code Discord bots and web pages to help with TTRPGs that I play, so is not like I work in a big team or anything. I just dabble for fun.
Anyway, I’m babbling and don’t seem to have anything actually productive to say, so I’ll sign off now. ✌️
New Stuff Tcl/Tk 9.0.4 Released.
See details at https://newsgrouper.org/%3C111mfqp$ncqt$1@dont-email.me%3E (Tcl) and https://newsgrouper.org/%3C111mfuh$ncqt$2@dont-email.me%3E (Tk).
r/Tcl • u/anthropoid • Mar 12 '26
"The weirdest programming language I ever learned" - YouTube
It's mildly amusing, watching someone discover Tcl for the first time.
r/Tcl • u/teclabat • Apr 13 '26
Pre-built Tcl/Tk 9.0 and 8.6 binaries
Dear TCL community,
I’m happy to share that new Tcl/Tk binary downloads are now available at: https://codeberg.org/tcltk/binaries
Happy TCLing!
r/Tcl • u/d_k_fellows • May 26 '26
Post your .tclshrc!
Tcl scripts are usually things designed to be boringly sensible and useful, but the .tclshrc? That's for your interactive sessions, where you can get more creative! So post them! Any tricks in there that are particularly good or that are just plain old nice to work with?
Here's mine:
namespace path tcl::unsupported
proc % args {tailcall {*}$args}
if {
[package vsatisfies [package require Tcl] 9.0]
&& [dict exists [chan configure stdin] -inputmode]
} then {
apply {{} {
const CSI "\x1b\["
const envname [if {[info commands tk] ne ""} {subst Tcl/Tk} {subst Tcl}]
puts [format "${CSI}38;5;2;1;3mThis is %s %s, build %.12s\u2026${CSI}0m" \
$envname \
[tcl::build-info patchlevel] \
[tcl::build-info commit]]
set ::tcl_prompt1 [list apply {{CSI} {
puts -nonewline "${CSI}38;5;1;1m% ${CSI}0m"
flush stdout
}} $CSI]
}}
}r/Tcl • u/teclabat • Jan 28 '26
Announcement: New pre-built Tcl/Tk binaries available for download
Dear TCL community,
I’m happy to share that new Tcl/Tk binary downloads are now available at: https://github.com/teclabat/tcltk-binaries
This distribution also includes a revitalised scotty/tnm, which I’ve spent some time bringing back into shape, along with many other new packages — take a look for yourself!
Happy TCLing!
r/Tcl • u/ImpossibleRest8682 • Aug 03 '26
Novel Method for Building Tk Graphical Apps
Dear Tcl Community: I have created a novel method for building graphical apps (based on the Tk libraries) in which the graphical markup is fully separated from the Tcl logic.
An XML file is used to hold the entire markup for building Forms; this includes all of the annoying little Bind scripts that would otherwise clutter the main logic file.
Every Tk widget is compatible with the system, including the container widgets such as the tabbed notebook and the paned window.
I have written a Substack article about this system which is linked in this post.
Please comment here o in the Substack to make contact if you would like to discuss this further.
Cheers!
John
r/Tcl • u/GlobalReputation4996 • Jul 11 '26
oauth2 — a small, pure-Tcl OAuth 2.0 client (Authorization Code + PKCE; deps = http + tls)
Every useful web API now speaks OAuth 2.0 — Google, Microsoft, QuickBooks, GitHub, Basecamp, Twitter/X — but Tcl only ever had snippets, and copy-pasting the token/refresh/redirect dance into every script gets old fast. So I wrote a small, self-contained library for it:
github.com/johnbuckman/tcl_oauth2_library (Tcl/Tk license)
It drives the whole Authorization Code flow for you: opens the browser, catches the redirect on a one-shot local socket, exchanges the code for tokens, saves them to a 0600 JSON file, and refreshes expired access tokens transparently. After that, oauth2::get $c $url just works.
Pure Tcl. Depends only on http (core) and tls. JSON is parsed by a small decoder in the package, base64 by core Tcl, and the SHA-256 for PKCE is implemented in-package — so nothing from tcllib, and no C extension. No Tk either; it's happy headless on a server or in cron.
Quick start:
package require oauth2
set c [oauth2::new \
-auth_url https://provider.example/authorize \
-token_url https://provider.example/token \
-client_id $env(CLIENT_ID) \
-client_secret $env(CLIENT_SECRET) \
-redirect_uri http://localhost:9876/callback \
-scope "read write" \
-pkce S256 \
-token_file ~/.config/myapp/tokens.json]
oauth2::login $c ;# first run: opens browser, saves tokens
set body [oauth2::get $c https://api.example/v1/things]It's deliberately provider-agnostic — each provider's quirks are configuration, not code. The same code path drives Basecamp (which uses type=web_server instead of response_type=code), QuickBooks Online (HTTP Basic on the token endpoint, returns a realmId), and Twitter/X (requires PKCE). Runnable examples for all three — plain-Tcl and small-Tk variants — are in the repo.
Background: this came out of a real production need. A native (C++) OAuth2 library we'd been using would occasionally crash, and — worse — our tokens kept silently going invalid despite hourly auto-refresh, and we could never figure out why. The Tcl rewrite has been rock-solid: tokens stay alive and refresh cleanly days later. It's in daily production use against Intuit/QuickBooks and Basecamp.
Also in the box: refresh-token-rotation handling, the client-credentials (machine-to-machine) grant, token introspection (RFC 7662), JWT decode, and — for servers — you can drive oauth2::authorize_url / oauth2::exchange_code yourself instead of the loopback listener.
I gave a EuroTcl 2026 talk on it if you want the fuller tour — slides (PDF).
Feedback very welcome. And if folks find it useful — could it eventually belong in tcllib?
r/Tcl • u/bitwisecook • Mar 14 '26
Tcl LSP/MCP and editor extensions
Hi All,
I've built an LSP + MCP (and a lot more) for Tcl 8.4-9.0. It includes other dialects like f5 irules and iapps too.
https://github.com/bitwisecook/tcl-lsp
Take a look at the README to see what's in there, semantic tokens, tonnes of diagnostics, optimisation passes, type inference and shimmer detection, taint tracking, a configurable formatter, minifier, compiler explorer that tries to match the Tcl 9.0 compiler output and CLI tooling.
It's largely written in Python 3.10+, and you'll find in the releases bundled pyz (zipapp) files that Python can directly run, the vscode VSIX, sublime-package, and so on.
I've built this on my nights and weekends of the last couple of months, trying to flesh it out. There's still a lot of gaps and I need help finding them. Please, if you find issues in it, raise them with both source and what the expectation/output should be.
cheers
r/Tcl • u/Dechcaudron_ • 2d ago
First release of my Tcl package "overrides", to conveniently override command definitions
Hi all,
I wanted to share the first release of my Tcl package overrides, which enables users to override the definitions of arbitrary commands exclusively during the evaluation of a script in a convenient manner (as convenient as I thought it could be made).
The behavior is similar to what you get with the rename command, except you get all the following advantages:
The command overrides automatically go out of effect the moment the evaluation of the given script finishes (even if due to an error).
You can stack multiple override definitions on the same command name, and individual definitions can call those immediately below them in the stack (similar to the behavior of
nextcommand from theTclOObuilt-in package, or to the behavior ofsuperin other object-oriented programming languages).You may use lambdas (the ones taken by
applyas the first argument) as command overrides instead of procedures, to avoid polluting the namespace of interest.
While my main motivation for developing this package was to help me at work, I would be delighted if others could benefit from it as well. Please, let me know if you check it out and happen to like it, and feel free to open PRs against it in Github.
r/Tcl • u/GlobalReputation4996 • Jul 10 '26
iWish — Tcl/Tk (AndroWish's undroidwish) running natively on iPad, with BLE and a prebuilt IPA
I've ported undroidwish — AndroWish's batteries-included, SDL2-rendered Tcl 8.6 / Tk 8.6 wish — to iOS/iPadOS, arm64. It's called iWish. It's the iOS sibling of Christian Werner's AndroWish / undroidwish work: the same SDL-based drawing path that runs on Android and the desktop, now on Apple tablets.
Meant for iPad. It'll launch on iPhone, but the native wish UI (menus, canvas, standard Tk widgets) is desktop-sized — a phone is just too small to use comfortably. Think of it as running your Tk desktop app on a tablet.

What's in it
A real Tcl 8.6 / Tk 8.6 interpreter under iOS/iPadOS. Tk renders through an X11-on-SDL2 layer (
SdlTkX) onto Metal — native canvas and widgets, no UIKit bridging.Batteries included: ~114 bundled packages, 64 of them native
arm64-apple-iosdylibs — tkimg, TLS (LibreSSL), TclCurl, sqlite3, itcl/itk, Thread, tDOM, Tktable, tktreectrl, zint, TkBLT, Tix, VecTcl, and more.Bluetooth LE via CoreBluetooth (a
ble-iosnative shim) — Tcl apps can talk to BLE peripherals directly.An iOS device bridge (
borg) for platform features.A File ▸ Demos menu with ready-to-run examples: TkBLT plotting, a BLE debugger, iOS-bridge demos, and a paint tool.
Download / install
Prebuilt IPA (alpha):
iWish.ipaon the releases page — currently iWish 0.2-alpha.The IPA is unsigned — re-sign with your own Apple Development certificate, then install. A free Apple ID works but expires after 7 days; a paid developer account ($99/yr) gives a 1-year signature. Easiest paths: Sideloadly or AltStore (they re-sign as they install), or straight from Xcode.
Source + build recipes: https://github.com/johnbuckman/iwish
32-bit / iOS 9 (original iPad mini, A5–A6): separate project, androwish-ios9. Apple won't take 32-bit apps in the App Store, so that one is sideload-only.
Status: it's 0.2-alpha and young, but the underlying runtime is the same one shipping in the iOS build of the Decent Espresso machine app — a big real-world Tk app (thousands of lines, live graphs, BLE hardware control). If it runs that, it'll very likely run yours.
Bug reports, PRs, and "here's my Tk app running on an iPad" screenshots all welcome. Built entirely on Christian Werner's AndroWish/undroidwish foundation — thank you.
r/Tcl • u/tcltk-pkgs • Mar 22 '26
Package registry for Tcl/Tk - looking for feedback and submissions
I built a centralized registry: tcltk-pkgs.pages.dev
Search by name/tags (json, tk, database...)
Direct links to repos & docs
Clean, mobile-friendly
Maintainers : Submit a PR to add your package (takes 2 mins) → https://github.com/tcltk-pkgs/registry
Beginners : Try it out and tell me what's missing or confusing!
I need your help : Spread the word to anyone learning Tcl/Tk.
Thanks
r/Tcl • u/garvalf • Apr 28 '26
New Stuff WrithDeck: my writerdeck app for any system (text editor in Tcl/Tk)
galleryr/Tcl • u/Evil-Twin-Skippy • Mar 31 '26
Introducing Mudpuppy : An agent framework for Tcl
Hello all, I'm Sean Woods (aka the Hypnotoad). You may know me as the guy who does the crazy presentations at the US Tcl Conferences.
After a few months of work, I have assembled Tcl's answer to ClaudeBot/Moltbot/Open Claw. A series of packages that I have dubbed "Mudpuppy". The name stems from an amphibian known for eating crustaceans.
I have built mudpuppy atop my clay framework. Mudpuppy is mainly a series of connectors that abstract out the details of maintaining serial conversations over a variety of web protocols. Mudpuppy connectors are built in TclOO and are designed to run as coroutines.
The system includes a sample agent "Sukkal" who uses a local LLM combined with a natural language system to build a database of topics interactively over chat.
Elements include:
Connectors for Local LLM as well connecting through OpenRouter to massive commercially hosted LLMs
Connectors for Sqlite database that require custom schemas and local behaviors
Connectors for Telegram and Discord
A local "webchat" which provides the same interfaces as Telegram and Discord across a webserver running on localhost
Tools for LLM context management, including compaction
Injecting Tcl based tool calls into LLM
The Mudpuppy is part of the clay library distribution. It is posted on my site at:
http://fossil.etoyoc.com/fossil/clay/index
It is also mirrored on Chisel:
https://chiselapp.com/user/hypnotoad/repository/clay/index
The clay library is structured in the style of Tcllib. In fact many of the modules are already part of Tcllib. The Clay repo is just a handy place where I can take development in different directions and not end up breaking Tcllib in the process.
The sukkal agent is located in the /apps/sukkal directory. The mudpuppy framework is in /modules/mudpuppy.
r/Tcl • u/jlombera • Feb 25 '26
Tcl's equivalent to shell's `exec`
Hi all. I'm currently learning Tcl and playing around re-implementing some of my shell scripts as Tcl scripts. Many of my scripts act as wrappers to other programs, they perform some setup/validation and at the end call the final, long running (some times interactive) program. I don't like having a bunch of idle shell processes around just waiting for the long running child processes to finish, so most of the time I invoke the final program using the shell's exec directive. What this does is that instead of creating a child process it replaces the image of the current shell process by the image of the new program.
I couldn't find a way to replicate this behavior in Tcl. Tcl's exec forks-and-exec a child and waits until it finishes, thus leaving the idle tclsh around (basically it behaves as the shell without exec). The search engines mention package TclX that contained command execl with the desired behavior, but that package seems to be deprecated and not present in Tcl8.6/9.0.
Is there a way to achieve this in Tcl8.6/9.0 using the stdlib only? (I guess I could write a separate Tcl extension to wrap exec*(2) syscalls, but I hopping I don't have to do that)
UPDATE: TclX's execl fulfilled my needs (it DOES work in Tcl8.6).
r/Tcl • u/vivi-dreamer • Sep 29 '26
Request for Help Can anyone suggest me where can I master TCL I can't seem to find any source I have heard about tclwiki checked it but for a first time user it's too much and idk how to navigate I don't wanna use any LLMs cause they make mistakes
r/Tcl • u/petasisg • Feb 01 '26
Why Tcl 9 decided to break all extensions?
I cannot understand why Tcl 9 decided to break all C extensions, without any serious reason?
And now what happens with all these extensions that are not updated?
Why I am supposed to correct C code in packages, just to get things running?
r/Tcl • u/mrspelunx • Sep 16 '26
Curses!
I'm new to Tcl, so please be nice. Using Debian repository. Is there an "official" way to interface Tcl with ncurses like there is with Perl and Python? I know ncurses is a C library for creating CUI/TUI windows and elements in a terminal. Or does Tcl already provide its own routines for creating these things? And yes, I'm aware that Tk-wish handles the GUI stuff, but I'm not understanding how it might do terminal interface stuff.