This describes explicit use, outside of cases where you may be using it directly or indirectly and not realize, like Expect, or in your network routers like your F5 iRules, etc.
My work is currently specifically Tcl-focused, at ActiveState, but see my other comments for years of enthusiastic Tcl experience from "general" development and operations gigs. I use it where I can, and I can use it in a lot of places.
This is definitely a sweet-spot for TCL. It's not surprising that TCL doesn't get more attention when this use case has been so stable for so long.
Tcl is pretty neat though. It has this feel like lisp and very simple rules plus everything can be a string, which is prefect for gluing text output together between tools.
Issues I have with Tcl:
* The syntax is as idiosyncratic as a Lisp, but has few of the advantages that Lisps get for homoiconicity.
* uplevel/upvar is a janky way to get metaprogramming. Compare metaprogramming in Tcl to that of Japanese Tcl errr Ruby.
* The Tcl runtime is outmoded.
I could probably think of others.
There's also the fact that Tcl's vaunted integration with C code has pretty much become par for the course in high level languages. I didn't find writing Ruby extensions to be any more painful than writing Tcl extensions. Modern high level languages also expose full-featured FFIs, so you often don't even need bindings.
Tcl was ahead of its time! It was a good embedded high level language before virtually every large project recognized the need for embedded languages. And the event-based model that Tk forced on it turned out to be pretty useful for network servers. It was a great choice in the late 1990s.
#!/bin/sh
# the next line restarts using tcl \
exec tcl "$0" "$@"
...
I just go so annoyed with is it /usr/bin/perl or /usr/local/bin/perl or ... And is it awk or nawk or ... And somebody told me this trick with Tcl and I was like, "I'll just use it for this simple script and be done with it."Can you really make arbitrary syscalls directly from Tcl? That sounds interesting to say the least
Rewriting it would be enormous effort and provide no business benefit and be full or risk of introducing new (or re-introducing old) bugs in the process of converting to some whiz-bang c# or whatever is trendy.
We even built custom integration modules (DLLs in Visual C++ 6 for anyone curious). They integrate to legacy AS/400 systems and the interfaces used are totally legacy and unlikely to be easy to integrate with c++ 2015.
So, we're absolutely still using Tcl (and Tk) in 2015 and it is still relevant. It will be in use until the company (or the sun) implodes.
I do hate the syntax though. Yuk. [edit: I see others commenting that that's the thing they like ! I'm obviously an outlier or our code sucks more than most.]
Furthermore, the "standard" Git tools "gitk" and "git gui" are written in Tcl.
There's an argument that modern software used in production environments shouldn't be imbued with a sense of playfulness just because it's fun.
If your choice is between tcl and Python, use Python. If your situation is "I can use waterer I want, tcl sounds fun," still use Python. Nobody wants to maintain sprawling tcl code today, much less in the future after projects get abandoned by their original creators.
Your point is a good one (applicable to any language or technology), but in defense of the OP, bringing fun doesn't preclude usefulness or power. A painful development process doesn't mean "serious software". Additionally, if you don't want to put Tcl in production per se, it can still be part of the development process in a prototyping capacity. It's got great UI facilities (CLI, sockets, GUI), great introspection, and a healthy amount of whip-it-up-atude to get meaningful results quickly (and yes, enjoyably).
This one capability puts Tcl in a class that is fairly unique among scripting languages. It gets it into the class of easily distributable languages that usually only includes compiled native binaries like Go, C, C++, Haskell, Ocaml, etc
EDIT: Thinking further, perhaps Node compiled statically and Lua may offer similar capabilities to Tcl in terms of being reasonably distributable. Maybe PHP also if you distribute the static cgi binary.
I guess it's mostly Python, Ruby, Java, C# and Perl that require a distribution to be installed for programs to be easily run. This is mostly a problem for distributing one-off utilities for someone else to run rather than either major applications where an installer wouldn't be comparatively a lot of extra work, or situations where the computers are all under the programmers control.
Not all code I write is even intended for production environments, that's where my previous comment was coming from.
libtcl is really easy to sandbox with seccomp, I recommend it over [interp create -safe]. Run the interpreter in a seccomp-enabled child and have the parent do all privileged operations. Set resource limits on the child. Have them communicate over a socketpair. Have the parent spawn sandboxed children whenever the rlimits run out. For what we're using it for, it works really nice.
See http://wiki.tcl.tk/1502 for descriptions, reactions, and links.
Caius – A functional testing framework in object-oriented Tcl
I think there are two points, where a browser plugin is still relevant: (1) connect with hardware or resources where a browser has no access, from a web page. That is when you can write a little companion Tclet to do exactly this little task. (2) Deployment of an existing Tcl application to thousands of users. That's so much easier when you just need to drop the .tcl file on a web server, and your users get the update as soon as they press F5 in their browser to reload the page.
So it has gotten used a lot around the edges of other software that I've written in C# or as part of config steps in InnoSetup.
It's a great tool for random little messy bits that need to be done where you don't want to deal with installing something larger.