[HN Gopher] Tcl-Lang Showcase
___________________________________________________________________
Tcl-Lang Showcase
Author : luismedel
Score : 108 points
Date : 2025-10-07 13:25 UTC (9 hours ago)
(HTM) web link (wiki.tcl-lang.org)
(TXT) w3m dump (wiki.tcl-lang.org)
| shanemhansen wrote:
| Tcl was my first "general purpose" programming language (after
| TI-basic and Matlab).
|
| When I started that job I didn't know the difference between Tcl
| and TCP. I spent a couple months studying Phillip Greenspuns
| books. It also made me a better engineer because unlike PHP I
| couldn't just Google how to do basic web server stuff so I had to
| learn from first principles. That's how I ended up building my
| first asset minification pipeline that served the "$file.gz" if
| it existed with content-encoding: gzip.
|
| Nearly 20 years later and I'm basically a http specialist (well,
| CDN/Ingress/mesh/proxy/web performance).
|
| Tcl is still kind of neat in a hacky way (no other language I've
| run across regularly uses upvars so creatively).
|
| Shout-out to ad_proc and aolserver.
| doodpants wrote:
| "By clicking on the image, an interactive demonstration of the
| Tcl/Tk application is launched using CloudTk."
|
| No it isn't; I just get an empty frame with a close button. This
| is consistent on multiple browsers/platforms.
| nu11ptr wrote:
| same here
| zamadatix wrote:
| I'm guessing it works fine until there is load :). The design
| does seem to just proxy noVNC to a Linux host.
| kragen wrote:
| I wonder if you could maybe just compile wish to Wasm with
| Emscripten?
| dizzant wrote:
| I used Tcl at my very first internship for test automation.
| Coming from a self-taught Javascript/Java/C#/C++ background, Tcl
| really stretched my concept of what a programming language is,
| especially how it plays with stack frames and munges string
| values.
|
| Coincidentally Tcl also inspired my first deep dive into Vim. The
| test automation framework at that company required meaty Tcl
| expressions packed into CSV cells. Tcl was mind-boggling enough
| when properly formatted, so hand-editing squashed 1800 character
| long expressions on a single line was way too much. I'm fairly
| certain the assignment was part hazing and the framework part
| "job security".
|
| Jokes on them, I spent 2 weeks on a side quest to make a Vim
| plugin that could add line breaks and indent a Tcl expression
| into a split temporary buffer for editing and squash it back to
| the right cell when I was done. Halfway through the summer I had
| completed the entire backlog. The manager got a reprimand for
| being a jerk and I spent the rest of the summer making the
| framework less painful.
| doublerabbit wrote:
| I'm currently working on a PXE provisioning system with Tcl. This
| crafts a KickStart configuration hosted on a virtual URL.
|
| LUks is a requirement and requires a random password on each
| workstation. Password generation with handmade web gui stored
| natively in sqlite all under 200 LoC so far.
|
| Tcl gets flak, but it's battle tested. Still under active
| development and has a cool GUI, Tk, I love it as a language. In
| terms of simplicity it just works out of the box, execution in a
| single file, in a sanely manner.
|
| Wrap a variable in brackets {} and you've secured yourself from
| injections or run the procedure in a lightening safe interpreter
| if your paranoid.
|
| Threading is a breeze. It does make you think in a different
| methodology which folk may rebuttal, but once you get it, it's
| great.
|
| NaviServer too, AOLs original webserver is awesome.
|
| https://wiki.tcl-lang.org/page/NaviServer
|
| https://github.com/naviserver-project/naviserver
| mzi wrote:
| Nitpick: it's flak, not flack. It's a german abbreviation of
| Flugzeugabwehrkanone or anti-aircraft gun
| justusthane wrote:
| I'll do another nitpick: "rebuttal" is a noun. "Rebut" is the
| verb you're looking for.
| doublerabbit wrote:
| Missed the edit window. Noted for the future though, thanks.
| sph wrote:
| I've been thinking of writing an extensible editor scriptable
| with Tcl, but - surely someone somewhere must have already
| written one, no? I couldn't find anything that wasn't just a toy.
| kragen wrote:
| This is a really interesting idea, and I don't know why I
| haven't seen one--it seems like such an obviously good idea.
| dlowe-net wrote:
| BBEdit started in the 90s and was an early adopter for TCL
| extensibility.
| ofalkaed wrote:
| I suspect there are a great many, Tcl/Tk makes it a very easy
| project but once you start using your editor to edit the code
| for your editor you realize you can edit your editor while you
| edit in it without restarting. Couple weeks later you have an
| editor filled with undocumented features and a weird skew
| towards editing the languages you use most and tailored to your
| personal coding quirks and style.
|
| At least that is how it went for me. Once I got basic
| functionality working it turned into something that evolves
| instead of being written; working on some project and realize a
| certain feature would be great, open editor's built in console
| and write a few procs, send it to the interpreter, test, save,
| continue on with other project, fully intend to document and
| improve/generalize later, repeat until it turns into something
| only you can use.
| shawn_w wrote:
| There have been a few but I think they're all dead these days.
|
| Alphatk for example: https://en.wikipedia.org/wiki/Alphatk
| seschwar wrote:
| Vim is scriptable with TCL: https://vimhelp.org/if_tcl.txt.html
| isr wrote:
| [tcl'ers wiki page on tcl editors](https://wiki.tcl-
| lang.org/page/Tcl+Editors)
|
| An interesting one I hacked around with for a while is
| [ma](https://github.com/kdltr/ma). It's a single window
| implementation of an acme-like editor. It was originally
| written (& still used by) Felix Winkleman, the creator of
| chicken scheme
| jhardcastle wrote:
| Tcl/Tk was used by the first open source project I ever
| contributed to 25 years ago - a client for AOL Instant Messenger
| called TiK. It was such a thrill to be able to hack on the
| client, see the changes in almost real time, and share with
| others. It's great to see Tcl still around and kicking!
|
| https://tik.sourceforge.net/
| KasianFranks wrote:
| In 1996/7 I had a chance to use Tcl/Tk to build one of the first
| stock tickers on the web called DigitalTrader [1], after that we
| used it to build some of the first vector embeddings in 2005 for
| early biological language models at Lawrence Berkeley National
| Lab [2,3] for space biosciences. Still a fan.
|
| [1]
| https://www.orafaq.com/usenet/comp.databases.oracle.misc/199...
|
| [2] https://newscenter.lbl.gov/2005/03/31/a-search-engine-
| that-t...
|
| [3] https://patents.google.com/patent/US7987191B2/en
| bitwize wrote:
| A lot of people on Hackernews get wistful for VB. But the VB of
| the Unix world is still here--Tcl/Tk. It's not for the faint of
| heart, but it's the fastest way I've seen to get from zero to
| functional GUI. Entire desktop environments have been built in it
| --before GNOME 1.0 even came out. It even has metaprogramming
| capabilities that approach Lisp in flexibility.
| badsectoracula wrote:
| VB and Tcl/Tk are _very_ different at a fundamental level.
| Nowadays the closest to VB would be Lazarus[0]. There is also
| Gambas[1] though personally i haven 't tried that recently (it
| also cannot make binaries for Windows FWIW) and back when i
| did, it was very clunky.
|
| Though there was an attempt[2] to make a Visual Tcl at some
| point. IIRC one neat aspect was that the program was actually
| live while you were designing it instead of having separate
| design / run modes.
|
| [0] https://www.lazarus-ide.org/
|
| [1] https://gambaswiki.org/website/en/main.html
|
| [2] https://vtcl.sourceforge.net/
| bitwize wrote:
| > VB and Tcl/Tk are very different at a fundamental level.
|
| Well, yes, I get that--and I much prefer Tcl. What I meant
| was it filled the role of "tool you use to get a GUI together
| quickly", especially in the early 90s. Gambas and Lazarus
| were not around back then.
|
| Lazarus is closer to Delphi than VB, and I've found it to be
| clunky also in practice if not in principle; Delphi took on a
| lot of production workload in the 90s, and having an open
| source workalike would be a boon to business. We seem to have
| trashed tools that enabled line-of-business apps to be built
| by single devs, only for AI companies to sell that ability
| back to us again in the form of LLM assistance. Sometimes I
| hate this civilization.
| ternaryoperator wrote:
| JavaFX has a role here too.
| IshKebab wrote:
| > but it's the fastest way I've seen to get from zero to
| functional GUI
|
| I think Qt Creator is still the best option I've used there. It
| has a very good GUI form editor (probably the only one I've
| ever used that _is_ good). You can have a basic GUI up and
| running in like 5 minutes tops. And C++ is a much better
| language than TCL, and Qt is a much better GUI toolkit than Tcl
| /Tk.
|
| Just steer clear of QtQuick and QML. It's kind of trash.
| QtWidgets is still supported though.
| DonHopkins wrote:
| Here's a talk I gave many years ago at the Toronto Usenix
| Symposium about porting SimCity to TCL/Tk:
|
| http://www.art.net/~hopkins/Don/simcity/keynote.html
|
| At that point in history (1993), TCL/Tk was ideal for what I
| wanted to do. It was very easy to integrate with C code (exposing
| the SimCity simulation engine and callback as TCL commands), and
| implement custom Tk components (like pie menus) and services
| (like a real time sound mixer).
|
| w_piem.c:
| https://github.com/SimHacker/micropolis/blob/master/micropol...
|
| I also made a multi player version of SimCity that took advantage
| of the X11 version of TCL/Tk's ability to open multiple displays
| at once.
|
| https://www.youtube.com/watch?v=_fVl4dGwUrA
|
| Multi Player SimCity Announcement:
| http://art.net/~hopkins/Don/simcity/simcity-announcement.htm...
|
| SimCity on SGI Indigo:
| http://art.net/~hopkins/Don/simcity/SimCity-Indigo.gif
|
| SimCity on Sun OLWM: http://art.net/~hopkins/Don/simcity/SimCity-
| Sun.gif
|
| SimCity on NCD X Terminal:
| http://art.net/~hopkins/Don/simcity/SimCity-NCD.gif
|
| I visited Professor John Ousterhout at his office at UCB with an
| SGI Indigo to give him a demo and express my gratitude and
| admiration, and demonstrated it running across two SGIs at the
| ACM InterCHI '93 conference Interactive Experience to demonstrate
| the cooperative multi player aspects like multiple views,
| multiple cursors, collaborative editing, and voting.
|
| http://www.art.net/~hopkins/Don/simcity/simcitynet.html
|
| Eventually I talked EA into open sourcing SimCity, cleaned up the
| TCL version, and released it on the OLPC (and renamed it
| Micropolis to not infringe on Maxis/EA's trademark):
|
| Open Sourcing SimCity:
|
| https://donhopkins.medium.com/open-sourcing-simcity-58470a27...
|
| micropolis activity:
| https://github.com/SimHacker/micropolis/tree/master/micropol...
|
| micropolis.tcl:
| https://github.com/SimHacker/micropolis/blob/master/micropol...
| rixed wrote:
| I have fond memories of many hours spent with my young daughter
| playing micropolis on my laptop while travelling by train
| accross Europe many years ago. Thank you for your work!
| ggcdn wrote:
| Many structural engineering graduate students still get exposed
| to TCL as its the input language of the OpenSees framework for
| structural and earthquake engineering.
|
| https://opensees.ist.berkeley.edu/wiki/index.php?title=OpenS...
|
| Luckily, there is also now a python interpreter.
| rickcarlino wrote:
| I wish more scripting languages (other than TCL and Python) had
| desktop GUI support out of the box. I don't even need a good one,
| just having an OK GUI lib that isn't a full blown third party
| webview frameworks would be nice for one off utilities.
| y1n0 wrote:
| I use tcl at work. It's fine, but it's one of those languages
| that's heavily tilted toward "easy to write but hard to read."
|
| TCL can be so customized that it's unrecognizable, breaking all
| compatibility between hosts.
___________________________________________________________________
(page generated 2025-10-07 23:01 UTC)