TCL is awful. I am unfortunately forced to use it because the entire EDA industry has settled on it as the scripting language of choice (silicon engineers tend to be pretty terrible programmers in my experience; despite silicon design and verification being programming they often excuse shitty practices by saying "we aren't software engineers").
Performance isn't such a big deal - even though he says it isn't as fast as a really slow language like Python, the scripts tend to be very short.
The issue is "everything is a string". Anyone who has written any significant Bash or CMake will be familiar with how shitty that is. TCL is actually a bit nicer than CMake or Bash, but it still suffers from the fundamental problems of stringly based languages.
Quoting is insane and hard to get right. Type errors are very common. I would say TCL has had a negative effect overall at least on the EDA industry. Maybe if it didn't exist we could have had a slightly nicer embedded language like Lua. Or even just a C API.
This really makes me wonder if you’ve used Tcl. Quoting in Tcl is so much simpler than in e.g. bash or cmake. It’s all about know when a string will be evaluated or not.
> Type errors are very common.
In my experience, no more so than in any other dynamic language, e.g. Python or Lua.
Again in my experience, if one wants a scripting language — i.e., one used to orchestrate a number of commands — then Tcl is exactly what the doctor ordered.
Funnily enough I'd never used Tcl until I started tinkering with FPGAs, and while initially I hated it, I went through a process of developing a grudging respect for it, and now actually quite like it!
What I will say is it's absurdly easy to write a Tcl extension - I wanted to talk to a soft CPU using a Xilinx Platform Cable USB (which isn't supported by OpenOCD). I ended up creating a simple Tcl extension around xc3sprog and it worked a treat - I'm pretty sure the engineering effort to do the same for a different scripting language would have been much greater.
On the contrary, compared to e.g. bash, unless you're doing something super unusual or wrong, you rarely have to think about quoting in Tcl. Use "" when you want substitution, {} when you don't, {*} when you need to pass a list as multiple words, construct lists and dicts using their appropriate constructors and never by hand — and you're safe. Unlike bash, quoting in Tcl is dead simple, predictable and never surprising.
I do prefer tcl quoting to bash quoting, but you do have some mental overhead when writing procedures, since unpaired braces inside quotes may do surprising things, if you're thinking "writing a command" rather than "raw strings". Comments are similar.
That being said, those are very much edge cases.
More damning, from my POV, is that you can't get ref counting of things like C objects or file handles, since they're just string handles. But there are a lot of uses that don't need that
Yes it's not as bad as some other stringly typed languages, but compare it to literally any other language with proper types. Even terrible ones like PHP don't have those issues.
Before Lua got popular, Tcl was the only sane option to add scripting to a project. The interpreter was trivial to embed and modify (for instance I created my own stripped down "minitcl" library which compiled to around 20 to 30 KBytes).
I actually really like TCL as a language. It’s very internally consistent, and quite powerful. Has a bit of a LISP flavor.
I agree that its syntax is pretty weird when compared to any other language. And a lot of stuff works differently than you’d expect if you’re coming from Python.
For me, there’s always a mental context switch that needs to happen before I can get in the flow with TCL. Once I’m there though, it’s a very fast/powerful language to implement stuff with.
Performance isn't such a big deal - even though he says it isn't as fast as a really slow language like Python, the scripts tend to be very short.
The issue is "everything is a string". Anyone who has written any significant Bash or CMake will be familiar with how shitty that is. TCL is actually a bit nicer than CMake or Bash, but it still suffers from the fundamental problems of stringly based languages.
Quoting is insane and hard to get right. Type errors are very common. I would say TCL has had a negative effect overall at least on the EDA industry. Maybe if it didn't exist we could have had a slightly nicer embedded language like Lua. Or even just a C API.