8 ms·
The Tcl Programming Language
- VWWHFSfQ 2y ago> this immensely flexible and versatile language I would be interested to know if anyone ever built anything non-trivial that didn't turn into a complete mess due to TCL's general type-flimsyness and "everything is a string" philosophy.
- coliveira 2y agoThere is no big difference between TCL and other languages like Python in this respect. Yes, TCL stores everything as a string, but it also assigns a type when the data is used. If you need a defined type, you can use structures; there are even classes/objects available as packages.
- remram 2y agoThat is absolutely not how Python works. Python values are typed.
- apgwoz 2y ago> "a dynamically typed language is a statically typed language with only one static type." — Bob Harper
- remram 2y agoYes but we are not talking about static types...
- apgwoz 2y agoYou’re misunderstanding. Dynamic languages inherently have a single type that is checked _at runtime_. Store it in a string, store it in a struct. It doesn’t matter.
- layer8 2y agoThe runtime values have tags that denote their runtime type. They are not of a single type. You are talking about static types.
- apgwoz 2y agoAnd in Tcl the runtime type is computed at time of use. An optimized Tcl could cache an integer with a string that represents an int to avoid that cost. Nevertheless, a runtime type tag is an optimization. That doesn’t make Bob’s statement any less true.
- remram 2y agoWhat you said above is correct but is not related to what was being discussed before.
- apgwoz 2y agoHow is it not related? Because Python is “strong typed” vs “weak typed” for Tcl? $ tclsh8.6 % expr 1 + 2 3 % expr 3 + “hey there” invalid bareword “hey” in expression “1 + hey there”; should be “$hey” or “{hey}” or “hey(…)” or … vs. $ python3.11 >>> 1 + 2 3 >>> 1 + “hey there” Traceback (most recent call last): File “<stdin>”, line 1, in <module> TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’ I don’t really see a difference. Both checked types at runtime. Clearly Tcl can check types at runtime, even though it represents everything as a string. Whether all commands do so is another story. But, not all functions in Python check types before trying to do things that don’t make sense, either. So…
- eadmund 2y ago> Python values are typed. So are Tcl values.
- 7thaccount 2y agoDoes it still do this? I thought they changed this many years ago?
- smj-edison 2y agoYep! It's called shimmering. The way it works is it has a string and internal representation. When the internal representation is modified it invalidates the string version. If the string version is needed later it'll regenerate the string representation. That way it can always be used as a string, but internally it is pretty efficient when it stays as the same type.
- cjbgkagh 2y agoA lot of old GUIs are built on Tcl/Tk, lots of people use matplotlib which I think uses it by default.
- timewizard 2y agoTCL stands for "tool command language." In terms of non trivial tools that have been built with it there have been several. AOLServer, MacPorts, tons of CAD and engineering software. There's a whole wikipedia category just for this: https://en.wikipedia.org/wiki/Category:Free_software_programmed_in_Tcl https://en.wikipedia.org/wiki/Category:Free_software_program... Aside from that there was Tk which was used to create many UIs in an era where scripted UIs were otherwise painful to create and maintain. A prominent example here is 'xconfig' from the linux kernel. Like any good environment a little bit of practice with it can see you overcome it's apparent shortcomings and see you producing reliable and useful software in far less time that you might have in a more traditional way. Programming is about trade offs. It's not a checklist of "good ideas."
- wildzzz 2y agoFor FPGA IDEs, a lot of the background is just tcl scripts so you can easily write your own build scripts. You could theoretically put them into your CI pipeline but I don't know if anyone actually does this.
- davidw 2y agoFlightaware, at one point, had a lot of Tcl code https://www.flightaware.com/about/code/ https://www.flightaware.com/about/code/
- benburwell 2y agoThis is still very much the case. Although most new code is written in other languages, Tcl still has a substantial presence.
- fuzztester 2y agowhat is your definition of non trivial?
- Treblemaker 2y agoSearch upthread for "Klines" and "80s"
- ks2048 2y agoWavesurfer was a great program written Tcl/Tk, with an audio processing library called "snack" in C with Tcl wrappers. https://en.wikipedia.org/wiki/WaveSurfer https://en.wikipedia.org/wiki/WaveSurfer
- 7thaccount 2y agoSqlite started as a tcl extension. That isn't exactly your question, but I thought it was closely related.
- mdaniel 2y agoAnd, AIUI, the monstrous test suite of SQLite is all in Tcl (which totally jives given your fact; they're obviously fans)
- jhayward 2y agoFor many years every web page at CNN and all web email at AOL was hosted by AOLserver and coded in TCL. It was not a mess.
- bigbuppo 2y agoI know in the late 90s, early 2000s they were Vignette shop, back when it was a Tcl application. Can only imagine their relief getting to carry over their tcl knowledge while no longer having to suffer with Vignette. I don't think I've ever heard anyone that actually liked Vignette.
- jhayward 2y agoI don't recall any groups using Vignette at AOL during that time. It may be that one of the acquisitions used it prior to being acquired, but again, I never heard about it.
- bigbuppo 2y agoCNN.com was definitely using the StoryBuilder part up until the 2005 redesign as it's noted in the source of each and every article, and there were some tell-tale droppings on the home page as well.
- ZeWaka 2y agoTCL/tk is used for the vast majority of integrated circuit verification tools. This is used by all the large manufacturers, even competitors use each others tools. Absolutely huge codebases, there's git blames that go back to the 80s.
- buescher 2y agoSomeone did a nice job of porting your revision control data. It would be fascinating to know what the previous systems were - probably svn or cvs, maybe both in chronological order, but before that?
- ZeWaka 2y agoNot my codebase, but they were SVN (still migrating, lol). No clue about before then, though.
- spacechild1 2y agoThe GUI of Pure Data (https://en.m.wikipedia.org/wiki/Pure_Data https://en.m.wikipedia.org/wiki/Pure_Data) is written in Tcl/Tk. In the 90s this was a popular and sensible choice, but not so much in 2025 :) I still have hopes that one day we'll manage to replace it with something better. (There are alternative implementations of Pd, such as PurrData or PlugData, that use different UI frameworks.)
- spacechild1 2y agogit-gui and gitk are also written in Tcl/Tk.
- bsder 2y ago> In the 90s this was a popular and sensible choice, but not so much in 2025 :) Infuriatingly, Tcl/Tk (and other things which use Tk) is still light years easier for doing basic GUI programming than anything that exists in 2025. How the hell can decades have elapsed and Tcl/Tk, Hypercard and VB6 are still vastly better for GUI development than anything we currently have?
- _mlbt 2y agoIn the same vein, Lazarus/FreePascal is an excellent open source and cross platform Delphi clone.
- graemep 2y agoI have been looking at using both of those. I have used TCL before but it was a while back, but Lazarus does have a visual designer which I have played with a bit. I am not sure which makes producing cross platform binaries easier. I ran into a few issues the last time I tried TclKit I ran into problems so Starkits may not be an easy solution anymore.
- _mlbt 2y agoLazarus is excellent. It is very user friendly once you get the hang of it, and you can use Delphi books to learn the language. It also produces static binaries that make it easy to distribute your software.
- bch 2y agoCisco iOS[0], F5 iRules[1], Tealeaf network monitoring/processing[2][3], Fidessa[4][5], … [0] https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ios_tcl/configuration/12-4t/ios-tcl-12-4t-book/nm-script-tcl.html https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ios_tcl/co... [1] https://community.f5.com/kb/technicalarticles/irules-concepts-tcl-the-how-and-why/275910 https://community.f5.com/kb/technicalarticles/irules-concept... [2] https://www.acoustic.com/tealeaf https://www.acoustic.com/tealeaf [3] https://help.goacoustic.com/hc/en-us/articles/360043279654-Configuration-settings https://help.goacoustic.com/hc/en-us/articles/360043279654-C... [4] https://www.cmegroup.com/solutions/market-tech-and-data-services/technology-vendor-services/fidessa.html https://www.cmegroup.com/solutions/market-tech-and-data-serv... [5] http://www.services.fidessa.com/brochures/_training/VF043.pdf http://www.services.fidessa.com/brochures/_training/VF043.pd...
- AdieuToLogic 2y ago>> this immensely flexible and versatile language > I would be interested to know if anyone ever built anything non-trivial that didn't turn into a complete mess due to TCL's general type-flimsyness and "everything is a string" philosophy. Both MacPorts CLI client[0] and ports tree[0] have used it successfully for many years. Regarding: "everything is a string" philosophy That can be said for the vast majority of Unix-like OS user-space programs. 0 - https://github.com/macports/macports-base https://github.com/macports/macports-base 1 - https://github.com/macports/macports-ports https://github.com/macports/macports-ports
- Treblemaker 2y ago100's of Klines of code in continuous development over the last 10 years, still currently maintained and continually adapted for new use cases in Electronic Design Automation (EDA) for logical and physical chip design and verification. Of course it's possible to create "write-only" code in tcl. But tcl is hardly unique in that respect. Good code design and coding practices help to avoid most issues just as in many other languages. "Everything is a string" (EIAS) is not what leads to a complete mess; it's failing to go beyond an initial, superficial understanding of the syntax and language capability and general lack of discipline that lead to un-fixable messes.
- pjmlp 2y agoA whole company, with our in-house version of AOLServer, using Apache and IIS plugins for the Tcl interpreter, running across AIX, HP-UX, Solaris, Windows 2000/NT, Red-Hat Linux, with our own ActiveRecord like approach (a decade before Rails happened), with connectors for Sybase SQLServer, MS SQLServer, Informix, Oracle, DB2, Access, doing code generation from Oracle based ER diagrams, and an IDE written in VB 6. Which became a business unit from Altitude Software, eventually due to our MSFT partnership level we got access to .NET builds before it was known to the world, as one of the key Portuguese partners, and started to replicate our stack in .NET, based on the learnings from our Tcl based product. The founders and core devs, from the original startup, eventually left to create their no code/low code platform, based on the learnings from both technology stacks, what they managed to achieve, and what was not done quite right, out of that OutSystems was born, one of the most successful Portuguese IT companies from the last 20 years. I think using Tcl for that startup on a tiny Lisbon basement back in the late 1990's, turned out quite alright.
- usr1106 2y agoI have known about Tcl since the 1990s. I remember Stallman advising not use it. Maybe he did not like the license? Yesterday, over 30 years later I was forced to write my first code. Noticed that a Cisco switch had an incredibly bad ssh implemtation, so to automate some commands I needed expect scripting. Expect is based on Tcl.
- 7thaccount 2y agoIf I recall correctly, I think he was just more of a lisp fan and promoted something like Guile or E-Lisp. It may have been license as well. I'm not very sure about it though.
- bch 2y agoI think he was worried about Sun Microsystems involvement[0] w Tcl when John Ousterhout went there[1], too. But mostly seems like a collection of unsolicited strawmen[2]. Also probably love-of-lisp. [0] That any proximity to commerce is evil? [1] https://en.wikipedia.org/wiki/John_Ousterhout https://en.wikipedia.org/wiki/John_Ousterhout [2] https://vanderburg.org/old_pages/Tcl/war/ https://vanderburg.org/old_pages/Tcl/war/
- bc569a80a344f9c 2y agoMost IOS implementations (classic, XE, XR) also have tclsh, a tcl REPL (that can also interact with the file systems to load and write scripts).
- dwheeler 2y agoPer http://vanderburg.org/old_pages/Tcl/war/0000.html http://vanderburg.org/old_pages/Tcl/war/0000.html Stallman's argument at the time was: "a language for extensions should... be a real programming language, designed for writing and maintaining substantial programs... The first Emacs used a string-processing language, TECO, which was inadequate. We made it serve, but it kept getting in our way. It made maintenance harder, and it made extensions harder to write... Tcl was not designed to be a serious programming language. It was designed to be a "scripting language", on the assumption that a "scripting language" need not try to be a real programming language. So Tcl doesn't have the capabilities of one. It lacks arrays; it lacks structures from which you can make linked lists. It fakes having numbers, which works, but has to be slow. Tcl is ok for writing small programs, but when you push it beyond that, it becomes insufficient. Tcl has a peculiar syntax that appeals to hackers because of its simplicity. But Tcl syntax seems strange to most users."
- 7thaccount 2y agoI own the first edition of this book and it's really good. I've written a few tcl scripts with it, but nothing major. Python just has the better ecosystem now for my needs. I might use tcl if I needed something really small though.
- jim_lawless 2y agoA TCL interpreter is packaged with Python in the tkinter library: import tkinter tcl=tkinter.Tcl() tcl.eval('puts "Hello, world!"')
- 7thaccount 2y agoI'm aware, but that kind of defeats the point (at least to me). If I want to build out some cute DSL for a project, it would just be with the small tcl interpreter.
- gricardo99 2y agoMy favorite Tcl story is a little side note about how Tcl could have been the language of the web[1] the founding of Netscape occurred at the same time I was deciding where to go in industry when I left Berkeley in 1994. Jim Clarke and Marc Andreessen approached me about the possibility of my joining Netscape as a founder, but I eventually decided against it (they hadn't yet decided to do Web stuff when I talked with them). This is one of the biggest "what if" moments of my career. If I had gone to Netscape, I think there's a good chance that Tcl would have become the browser language instead of JavaScript and the world would be a different place! However, in retrospect I'm not sure that Tcl would actually be a better language for the Web than JavaScript, so maybe the right thing happened. Too humble Dr. Ousterhout! It would have been a far better language. 1 - https://pldb.io/blog/JohnOusterhout.html https://pldb.io/blog/JohnOusterhout.html
- buescher 2y agoIn that world, Netscape might have also acquired Naviserver instead of AOL. Wasn't the plan at Netscape to make money on their server software?
- neilv 2y agoI was leading a Tcl project around then, and, though there were some very neat things about the unusual Tcl evaluation model, I wasn't a fan of using it for nontrival work. For example, it wasn't a natural fit for working with graph structures like I had to, and like you might want for browser DOM. (That said, Tcl would've been much better than JS, and I suspect that Ousterhout would've figured out some smart things to make it good for the browser.) Maybe 5 years later, I was meeting with Tim-Berners Lee, and I kinda pitched Scheme to him, without planning to, but he was very interested when he asked what I'd been working on. But then he went and did a conference keynote, in which he promoted Python as the language for ordinary people doing Web stuff. And I think he referenced one of the things I'd written in support of Scheme... as an anti-requirement for his populist vision for the Web. :) (I wish I could've been involved in that, because I could've made a case for a populist spin on Scheme at the time.)
- shanemhansen 2y ago
- Fruitmaniac 2y agoIs Tcl still a thing? At my first job I extended with a set of data-processing commands.
- monetus 2y agoIt is still actively developed and used, yeah. People tend to mention the fpga scene most, tcl is the predominant language there, but I use it mostly with or along side audio/visual software.
- stevekemp 2y agoI used it for scripting routers, more than anything else. I guess expect became something almost popular enough to be considered external to TCL in the end, too.
- fuzztester 2y agoExpect is very cool and useful. I have used it some. I read almost the full Expect book by Don Libes, the author of Expect, several years ago. He had a unique and very interesting style of writing, in that book. Yes, so popular that there are also ports of Expect to some other languages, such as Python and others.
- Treblemaker 2y agoMany of the big EDA (Electronic Design Automation) tools continue to use tcl for the command line interface. Some users have created quite complex, customizable design flows spanning multiple tools and even development infrastructure (much, much more than just "stitching tools together) using tcl.
- smj-edison 2y agoFunny that Tcl was mentioned today. I've recently been hacking on jimtcl[1] (a small footprint implementation of Tcl) to make objects multi-threaded safe, as that's the core language that folk.computer[2] uses (the main authors are making the interpreter and reactive DB parallelizable rn, so I've been tinkering with how to reduce copying). [1] https://github.com/msteveb/jimtcl https://github.com/msteveb/jimtcl [2] https://folk.computer/ https://folk.computer/
- deleted 2y ago[deleted]
- synergy20 2y agoI had this book, it's well written.
- dvektor 2y agoSurprised no mentions of sqlite yet :) I've always associated Tcl with sqlite because of how much it is used in their test suite and how you can have a tcl interpreter as a virtual table. Very interesting and seemingly often overlooked little language.
- graemep 2y agoI have used both TCL and Sqlite a fair bit but not both together. I have thought that TCL + in memory Sqlite would make a powerful combination for some tasks but have never actually tried it. > have a tcl interpreter as a virtual table Do you mean this: https://sqlite.org/src/file/src/test_tclvar.c https://sqlite.org/src/file/src/test_tclvar.c ?
- oldlaptop 2y agoI can't comment on virtual-table shenanigans, but I'll enthusiastically confirm that thought. Not only is an in-memory database powerful and useful for all the obvious reasons, but (I would argue) the Tcl interface to SQLite is perhaps the best relational database API in any language. (Even if it cheats a bit by being an embedded database, as with <https://sqlite.org/tclsqlite.html#function https://sqlite.org/tclsqlite.html#function>.) It's easily as synergistic a combination as Tcl and Tk themseves, possibly more.
- WillAdams 2y agoThere is a source release at: https://www.tcl-lang.com/software/tcltk/9.0.html https://www.tcl-lang.com/software/tcltk/9.0.html but I'm not seeing an easy binary download --- used to be that the availability of a pre-compiled version, nicely packaged which would install easily on one's platform of choice made it wonderfully accessible to new users. Is that not a focus of the project these days?
- Falcondor 2y agoLooks like binary downloads are on another page and not necessarily made by tcl-lang https://www.tcl-lang.com/software/tcltk/bindist.html https://www.tcl-lang.com/software/tcltk/bindist.html
- WillAdams 2y agoFrom that page: - Android 8.6.10 https://androwish.org/download/index.html https://androwish.org/download/index.html - Activestate seems to require account creation: https://www.activestate.com/pricing/ https://www.activestate.com/pricing/ - Windows, nightly build of 9.0.2 from 15 February: https://gitlab.com/teclabat/tcltk/-/packages/34837768 https://gitlab.com/teclabat/tcltk/-/packages/34837768 - Windows 8.6.7 https://www.irontcl.com/index.html https://www.irontcl.com/index.html This looks like the link I was looking for: Windows 9.0.1: https://www.tcl3d.org/bawt/download.html#tclpure https://www.tcl3d.org/bawt/download.html#tclpure which links to: https://www.tcl3d.org/bawt/download/Tcl-BI/SetupTcl-BI-9.0.1-x64_Bawt-3.0.1.exe https://www.tcl3d.org/bawt/download/Tcl-BI/SetupTcl-BI-9.0.1...
- bch 2y agoI was going to say releases are published to Sorceforge[0] but indeed those look to be all src too. That said: I’d be surprised to find a distro that doesn’t have Tcl available in whatever package manager(s) they support. [0] https://sourceforge.net/projects/tcl/ https://sourceforge.net/projects/tcl/
- WillAdams 2y agoManaged to find two Windows binaries as noted elsethread. It would be nice to have found one for the Mac....
- mdaniel 2y ago> Some content has been removed in the second edition of the book because of limits on the number of pages Lol, wut? The literal only working "buy it now" link is to a PDF. Page limits my ass. Or maybe "Paperback: 660 pages" was dangerously close to the Devil himself springing forth from the pages and turning all your codebase into VBScript
- at_a_remove 2y agoI may have to learn its other half, Tk, as a side project of mine is starting to feel less like something I can pull off as a "wizard" on the command line. I had wrestled with wxPython many moons ago and, while I got through it, I felt like I had perhaps taken a wrong turn. As a side note, while I have seen many UI elements over the decades, I cannot help but think that the wizard (or whatever you would like to call it) has somehow escaped being listed as a standard UI element. Perhaps it is too large to count for many.
- pjmlp 2y agoNice memories of having our own AOLServer like clone, Vignette, routinely writing extensions in C, and also why since 2003 I tend to avoid languages without JIT/AOT unless it is for banal OS and application scripting task.
- fithisux 2y agoBest of the best. Bought it.