News for hackers. Stuff that matters.
Re:The Birth of Tcl by 7thaccount on Thursday April 21, 2022 @06:12PM (#31115808)
I really like Tcl the language and some of the tooling, but certainly not all of it.

I kind of wish there was a single reputable website that I could go to for all versions. I don't want something from Source Forge or ActiveState or some random person's website. I'm sure they're all fine, but I'm a lot less sketched out with running Anaconda Python or Java than Tcl. Funny enough, some Python systems include Tcl for the Tk GUI, but I haven't been able to get some of the libraries I'm interested in to work with that version.

Re:The Birth of Tcl by hota_mazi on Thursday April 21, 2022 @07:46PM (#31116575)
TCL has a feature which to me qualifies as a total "What the hell were they thinking?", not unlike the COME FROM command from Brainfuck, except, in a real language.

That statement is upvar [1]. Read its description and despair.

[1] https://www.tcl.tk/man/tcl/TclCmd/upvar.html

Re:The Birth of Tcl by zvr on Friday April 22, 2022 @06:48AM (#31120110)
The upvar (and uplevel) mechanism is essential for the extensibility of the language and tremendously useful for creating new control constructs.

Think of it as similar to "passing value by reference", for example when you pass the address of a variable in C/C++.

Re:The Birth of Tcl by sokoloff on Friday April 22, 2022 @06:44AM (#31120086)
As the decr example at the very bottom suggests, it’s to allow the equivalent of passing a mutable reference into a function in other languages.

upvar and uplevel seem scary/strange when you read about them, but once you start using them in code, they feel perfectly suited for the task.

Re:The Birth of Tcl by cafard on Friday April 22, 2022 @09:04AM (#31121096)
I love upvar and uplevel.

I once did a web search to see whether there was an equivalent in PHP. I found a thread in at PHP forum, which told a poster that he was a bad person for wanting such a thing. (This was a long time ago, so perhaps I exaggerate. But they did say that PHP was just fine without it.)

Re:The Birth of Tcl by macintux on Thursday April 21, 2022 @10:35PM (#31117608)
As a fan of immutability (edit: I suppose I should say rather referential transparency is more relevant here), that horrifies me, but at the same time I have to commend the ingenuity.