Readit News logoReadit News
stevekemp · 2 years ago
This seems like a good time to repost antirez's piece, "TCL the misunderstood":

http://antirez.com/articoli/tclmisunderstood.html

TCL is a fun language, which seemed to get orphaned ahead of it's time. Like FORTH a lot of the joy of using TCL comes from updating the language itself, rewriting how it works. The downside of that is that you're never sure what is "real" TCL, and what is your in-house addon.

Still TCL is a fun language to implement, and I guess a lot of people have implemented both FORTH and TCL, in addition to the more typical LISP systems.

bandrami · 2 years ago
I remember a time when it was an honestly-debated question whether it would be TCL or Scheme that would become the universally adopted extension language for all software, particularly for this new interesting technology known as the World Wide Web.
arp242 · 2 years ago
From the HTML4 spec:

    <INPUT name="edit1" size="50">
    <SCRIPT type="text/tcl">
      proc edit1_changed {} {
        if {[edit value] == abc} {
          button1 enable 1
        } else {
          button1 enable 0
        }
      }
      edit1 onChange edit1_changed
    </SCRIPT>
I did some Tcl and that went fine, but I never did enough to really have an informed opinion. I know some people really hate it though.

It also has examples in VBScript and (of course) JavaScript. The W3C people did try to spec things beyond "just JS", but it was not to be.

RHSeeger · 2 years ago
> I did some Tcl and that went fine, but I never did enough to really have an informed opinion. I know some people really hate it though.

As someone in the opposite direction, having done lots of Tcl, I love it. It is one of my favorite languages to use. I use it for simple little things on a regular basis.

IshKebab · 2 years ago
Jesus, I know JavaScript is not great but wow we dodged a bullet there!
7thaccount · 2 years ago
Do you sometimes feel like you're living in the darkest timeline (Community Reference) or in the Star Trek timeline where the Terran Empire reigns instead of the Federation? I joke of course, but getting JavaScript instead of Scheme just seems like a let down.
earthboundkid · 2 years ago
Strange New Worlds has hinted that the timeline we’re on is shifted because Khan was supposed to conquer Earth in the 90s, but now it’s the 2030s due to various temporal shenanigans.
at_a_remove · 2 years ago
I feel like if I were more coherent I could write an epic rant about how we are definitely in a bad timeline because of our technological choices. How we built the Internet "wrong" at so many little choices and now we have *waves arms about wildly* this nonsense, but I would be shouting into the wind, I think.
fuzztester · 2 years ago
During the dot com boom days, there was a company called Vignette, that was hiring devs to work in Tcl on web app. Might have been work using AOLServer, a web server by AOL, that could be programmed in Tcl. I remember this because I saw their job ad in a newspaper at the time.

I googled a bit and found:

https://en.m.wikipedia.org/wiki/Vignette_Corporation

Ex-CEO (later chairman) became a millionaire. Excerpt from above page:

[ In June 1998, Garber hired Greg Peters to succeed him as CEO, and Garber became chairman of the board.[12]

In July 1998, the company launched StoryServer 4, which featured strong support of XML technology.

By December 1998, the company raised an additional $27.5 million in venture capital.[4]

The number of the company's customers rose from 130 in 1998[5] to 700 in 2000.[3]

On February 19, 1999, during the dot-com bubble, the company became a public company via an initial public offering. On the first day of trading, the stock price rose 152%, from $19 to $47.[13]

On February 22, 1999, the company release Vignette Syndication Server.

After the IPO, in 1999, Garber, worth $200 million at the age of 33, sold most of his stock and left the company.[14] ]

https://en.m.wikipedia.org/wiki/StoryServer

cmacleod4 · 2 years ago
I remember people who worked with StoryServer saying Vignette had made a real mess of the integration with Tcl :-(
davidw · 2 years ago
It's a real pity that server side Tcl wasn't more of a thing. It's a great language for it.
lmm · 2 years ago
AOLServer was doing async with it before most people knew what that was. Literally decades ahead of its time.
smrtinsert · 2 years ago
Did years of aolserver. Wrote some amazing stuff in tcl. Only python comes close lately to the power and clarity I could get with it.
_benj · 2 years ago
I really like Tcl for scripting. It integrates better and any other language I know with the shell and making a simple quick gui that runs some cli script or command based on some (also gui) inputs is fantastic! (using Tk)

I wrote a little silver for wordle in Tcl, but that’s a funny statement because it was mostly using ripgrep calling /usr/share/dict/words but I think that’s part of it charm, it get out of the way and let use you whatever tools and integrates them beautifully!

tgv · 2 years ago
I've never liked it. I tried it when it was getting some traction (which must have been in the 90s, I guess?), in particular because of Tk (initially I thought Tcl/Tk was the name), and I found it a horrible experience. Its "everything is a string, even this line of code" was way too hacky for me. It was too easy to make errors, and I suspect that sql injection pales in comparison to what careless string manipulation in tcl can do.
coliveira · 2 years ago
I believe that the fact that tcl integrates so well with UNIX is exactly the reason why industry doesn't like it. They want to invest in languages and technologies that can work seamlessly in commercial OSs like Windows and macOS.
jolux · 2 years ago
UNIX was originally a commercial OS…unless by UNIX you mean Linux or BSD. Plus macOS is UNIX too.
ofrzeta · 2 years ago
macOS is Unix, though.
vodou · 2 years ago
Good work Mr Ousterhout.

30+ years later Tcl/Tk is still in active use. In space industry (maybe more on the old side of the old/new space dichotomy) it is used everyday to command and control satellites (both simulators and flatsats on ground and actual satellites in space).

pabs3 · 2 years ago
Interesting that Tcl uses Fossil for their development, I wonder how many projects out there are using it instead of Git/GitHub.
ankitrgadiya · 2 years ago
Tcl, Fossil and SQLite share an interesting history. SQLite started as a Tcl extension and the SQLite maintain Dr Richard Hipp is part of the Tcl Core Team as well. Fossil started out as a version control for SQLite development by Dr Richard Hipp as well, and might have influenced the Tcl development as well.

Source: https://www.sqlite.org/tclsqlite.htmlhttps://wiki.tcl-lang.org/page/D.+Richard+Hipp

rkeene2 · 2 years ago
I did (along with the help of several other people finding, building, and testing tools) the migration of Tcl from CVS to Fossil during the great Sourceforge outage. We looked at many options for migrating to such as Darcs, Git, Bzr, and Mercurial -- Larry McVoy (bitkeeper author and Tcl contributor and supporter, also on HN) offered Bitkeeper support as well. The core team liked Fossil the best at the time though -- some people do not view this as the right decision to this day.

It seems to be working out okay, though!

andrewshadura · 2 years ago
D. Richard Hipp, not Dr (D. is an initial, not a title)
pabs3 · 2 years ago
Huh, from web searching for "fossil clone" and similar it is more common than I thought. There is even a GitHub-esq hosting site for it.
orhmeh09 · 2 years ago
Fossil also uses Tcl for some of its web stuff, iirc!
zaebal · 2 years ago
Sqlite
arroz · 2 years ago
TCL is still the language of choice for EDA
IshKebab · 2 years ago
Unfortunately. It's not too bad for interactive use (it's somewhere between Bash and Python in terms of sanity; maybe closer to Bash). The problem is people end up writing huge scripts and workflows all TCL which is just way beyond its wheelhouse. Often with a bit of Make and Bash thrown in to make it especially awful.

Sadly there is no end in sight because all of the proprietary tools use it and you can't really do anything about that.

They did add a bytecode runner in one version of TCL and I experimented with making a new language that would compile to TCL bytecode, but unfortunately one of our tools (PowerArtist I think) still bundled TCL from 2005 or so and didn't support it.

I also experimented with a WASM to TCL transpiler, and got it to work a little, but the WASM spec is actually quite big and the TCL code you get out is huge so I don't think that is the right way really.

The only good thing about TCL is that it's value based, not reference based. Value based languages are much more intuitive and easy to reason about, but unfortunately most languages are reference based.

djmips · 2 years ago
Would you like to elaborate on the meaning of value based versus reference based?
inomenic · 2 years ago
Wow, had no idea. Is there a rich ecosystem for this?

Is this on the level of R/tidyverse/ggplot?

lizknope · 2 years ago
I have no idea what tidyverse or ggplot are.

The two dominate EDA companies are Cadence and Synopsys. All of the digital design tools for synthesis, place and route, and static timing analysis use the Tcl language as the built in scripting language. These tools have literally thousands of built in commands.

You can look up some of the tools like Cadence Innovus that I use every day. A single license has a list price of over $1 million. We get big discounts because we have about 800 licenses.

https://www.cadence.com/en_US/home/tools/digital-design-and-... Then you write more Tcl code to script things within the tool. A standard thing is building a power grid. You need to write a for loop to build a metal 1 stripe every 5 microns. That's done in Tcl.

You have a list of clocks you need to define with names and frequencies. Use a Tcl array and a for loop.

Our CAD flow is literally tens of thousands of lines of Tcl code to take Verilog and go through all the steps until we get a GDS file with mask data to manufacture.

rhelz · 2 years ago
The "ecosystem" would just be, e.g. the suite of ASIC place and route tools, or FPGA synthesis tools, provided by each company. They pretty much all have TCL built in, for to help script them all together.

Each individual script is typically very ad-hoc, to address a specific shortcoming in a tool, or to get a particular mix-and-match of tools from various vendors integrated into a design pipeline.

That being said, it is an ancient and venerable tradition, dating back to the creation of tcl itself, and as long as we're making chip from Silicon it will be the duct tape holding it all together.

tn1 · 2 years ago
Not really. Most of the tcl that gets written is very straightforward and business-logic. The framework you're using is pretty much just the host tool. Trying to integrate other libraries is often difficult if the tcl runtime is missing some features (looking at you, xilinx...)
sweetjuly · 2 years ago
There really isn't an ecosystem. It's mostly just used for driving the tools and describing the configuration. For example, if you needed to generate power straps for an ASIC, you'd add a line to your place-and-route tcl script to generate them.
xorcist · 2 years ago
Some fifteen years ago I briefly worked with Cisco VoIP and the IVR was all Tcl scripted.

F5 BigIP load balancers has hooks in Tcl that control the balancing and can rewrite requests.

So there are niches for Tcl still. Nice language.

pjmlp · 2 years ago
I used Tcl in anger during 1999 - 2003, on our own version of a application server with a similar design approach as AOLServer.

It was Rails before DHH ever came up with the idea, but on a tiny startup in Lisbon that the world never cared about.

Handling automatic generation of database bindings based on parsing SQL92 DDL generated from modeling tools, running across all major UNIX and Windows NT/2000, across DB2, Oracle, Informix, Sybase SQL Server, MS SQL Server, and even Access, just because we could.

While it was a great experience, having to constantly rewrite Tcl code into C for performance reasons, is why afterwards I never used a language for production deployment that didn't had a JIT or AOT toolchain on their reference implementation.

To this day I don't bother with Python and Ruby for anything beyond UNIX scripting.

The founders of that startup also shared the same point of view, building OutSystems on top of .NET, based on our ups and downs delivering that Tcl based application server into several kinds of production workloads.

monetus · 2 years ago
Thanks to donal fellows and miller puckette for having helped guide me through the tcl world. Having used it so much, tcl has been as indispensable for me as it has been obligatory.