Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Would you like to elaborate on the meaning of value based versus reference based?


What does this print?

   a = [1, 2]
   b = a
   a[0] = 3
   print(b[0])
In JavaScript, Java, C#, Dart, Python, etc. it will print 3 because a and b are references to values.

In C++, Rust and TCL, (and maybe Go? I don't remember) it will print 1 because a and b are values.

In value based languages you need explicit syntax to make references and dereference.

In reference-based languages you need explicit syntax to copy values. Often this is omitted entirely which is quite annoying. Until very recently the standard solution to copy a variable was to serialise it to JSON and back again!!

Also worth noting that for immutable values (i.e. all values in Haskell, strings in JavaScript, etc.) there's no observable difference between the two.


Thanks for taking the time to explain that. I don't think I ever knew this a clearly as I now do!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: