Live data from Hacker News

Tcl the Misunderstood (2006)

antirez.com

21–30 of 81 posts

Re: Tcl the Misunderstood (2006)

#22
Tcl forces you to create new data, because you have to think and work harder to introduce effects on variables in upper scope through the use of uplevel and upvar. This reduces side effects significantly and makes data transformation explicit. Which, in turn, reduces cognitive load and increase productivity.

Tcl also does not have distinguished NULL value like Python, C, C++, C# and many other languages. You do not have to account for that.

The reduction of side effects and no universal no-value value puts Tcl in my hierarchy of programming languages right below Haskell and above pretty much everything else. Tcl is very easy to use when you know how to structure the program.

I still use it for various prototyping when I do not want strict type discipline.

Re: Tcl the Misunderstood (2006)

#23
Watching someone learns basics of programming in Python, I realized that Python is actually not that easy to learn for beginners as I thought:

1. Types in Python are implicit. It's really hard to explain that they need to always think about what type something is, especially when they haven't grasped the concept of types yet.

2. Indentation as part of the language. I thought it's a great thing for beginners, but it's actually confuses beginners that empty space affects your program, e.g. they think that spaces around assignment or arithmetic operators should affect their program too, which is not the case.

3. Ranges for iteration -- they just memorize the syntax blindly :(

So I started to wonder whether Pascal is better to learn for beginners -- you have to list all the types at the beginning, and no implicit conversions are done.

But now I think what about TCL? Maybe it'd be even easier for total beginners?

Re: Tcl the Misunderstood (2006)

#24
post #23

Watching someone learns basics of programming in Python, I realized that Python is actually not that easy to learn for beginners as I thought: 1. Types in Python are implicit. It's really hard to explain that they need to always think about what type something is, especially when they haven't grasped the concept of types yet. 2. Indentation as part of the language. I thought it's a great thing for beginners, but it's…

You could try something with a regular syntax. It doesn't work for everyone, but when it works it works really well. Racket comes to mind, and it has a progressive suite of languages from neophyte to full-blown. In addition to a community focused on pedagogy and CS fundamentals.

https://racket.discourse.group/

Re: Tcl the Misunderstood (2006)

#26
Some discussions over the last several months, including just yesterday:

* The Birth of Tcl: https://news.ycombinator.com/item?id=31111220

* TclTutor 3: https://news.ycombinator.com/item?id=30327945

* Tcl/Tk Spline Editor: https://news.ycombinator.com/item?id=29772621

* Tcl library for CSP: https://news.ycombinator.com/item?id=29421786

* Why Tcl syntax is so weird: https://news.ycombinator.com/item?id=29143346

* Tcl: Lisp for the masses: https://news.ycombinator.com/item?id=28957701

Re: Tcl the Misunderstood (2006)

#27
The thing that I most appreciate about Tcl is that it feels like Unix shell "done right". It is still a bit weird because everything is a string, but it doesn't have all those footguns around variable expansion, such as word splitting. It also has decent support for subroutines and local variables, no weirdness with subshells and so on.

Re: Tcl the Misunderstood (2006)

#28

My favourite thing about Tcl is (was? This was 25 years ago) that adding commands just requires a couple of Tcl things, then an argc/argv, so it was relatively simple to turn an existing C program into a Tcl command: int my_command (ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) { ... } However, that might have been the only thing I liked about Tcl. For some binary data import tasks I ended…

Binary data import was probably the antithesis to Tcl's "everything is a string".

Re: Tcl the Misunderstood (2006)

#30
post #19

This article fails to note that Tcl is very closely related to shell script. A lot of the concepts listed already exist in Shell, and nobody complains that Shell is only a toy language.

Many complain that shell scripting isn't suitable for anything longer than few lines.
Post reply on HN