Live data from Hacker News

Tcl the Misunderstood (2006)

antirez.com

41–50 of 81 posts

Re: Tcl the Misunderstood (2006)

#41
post #36
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…

The traditional answer was to use a BASIC dialect. Minimal syntax, minimal structure, simple imperative commands. A lot simpler than Pascal. I don’t know TCL very well, but its scope semantics may be confusing. I’d take a look at LOGO also.

The only problem with BASIC is that it's kind of gross scaled up for medium-sized applications. It's downright charming at the Tiny-BASIC, VIC-20 BASIC, or even BASIC-52 level though.

LOGO has real depth, an elegant syntax, and there's an alternate universe where it has Python's niche as everyone's favorite scripting language. But it's effectively a toy language so there's nowhere to go from "learning".

Here's my hot take: before you teach anyone "the basics of programming", teach them how to enter formulas in a spreadsheet.

Re: Tcl the Misunderstood (2006)

#42
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…

I had the pleasure to actually learn Pascal (Delphi actually) at school. I think it is a awesome teaching language.

Though it also showed the problem with teaching languages: The students were not that eager on it. They would have preferred a languages with better job prospects.

As motivation is the key for success to learning, yeah sometimes the language that offers the quickest benefits is a good choice. The strength of Python is that it has great libraries in very trendy fields that allow to get stuff done with very little knowledge. That is why both Python and JS (easiest to get a job) are good beginner languages. (That really hurts me to write as learning should not be solely focused on external rewards but such is the world currently)

That said, if I were to choose a language to teach programming then Lua would be the perfect candidate. It avoids the syntax pitfalls of Python as well as having much lower complexity while still being very powerful. Plus really great for gamedev so many motivating examples.

Re: Tcl the Misunderstood (2006)

#43
post #5

What I like most about TCL is that a TCL REPL feels a lot more like a normal command prompt than Lua or Python or whatever. If I’m going to write a complex program, TCL wouldn’t be my first choice, but if a program I’m using has a command prompt (think autocad or the debug console a lot of games have). Plenty easy for one-off commands, but with a simple and powerful programming language there if you ever need it. Put…

Yeah, that may be why it became popular in CAE/EDA tools, one of the the few places it remains used these days. IMO Tcl works well for that use case, but it often catches shit from people who've had to use it. I think it's either because they misunderstand the language (as in the article, but also not that people who use CAE or EDA tools may have very little programming background) or that the vendor APIs provided to interact with the tool are very poorly designed (which I have definitely experienced).

Re: Tcl the Misunderstood (2006)

#44

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:…

Yes. I've been kind of wondering about the apparent promotion of Tcl here recently - is someone pushing it for some reason, or is it just a passing fad in a slow (tech) news time?

Re: Tcl the Misunderstood (2006)

#45
post #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 h…

Does this non-existence of a no-value not only mean, that when there is no result value, another value (like false or empty string or empty list or whatever) will be used to express that fact, or that an exception is used? One would have to check for those in some cases as well. Those might not be always good alternatives reducing required checks. How does it work?

One fundamental principle in tcl is that everything is a string (EIAS) [1]. Therefore, an empty string "" is the same thing as a "null value" or 0-length list, but generally doesn't require any special treatment (your function that takes a list as input generally should know how to handle empty lists).

[1] In practice things are typed in the interpreter internals for performance reasons, but the language behaves as if EIAS.

Re: Tcl the Misunderstood (2006)

#46
post #38
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…

I've seen beginners, especially those without a very strong maths background, struggle with the concept of syntax. The idea that you need to put the thing you want the program to do into a very specific form. That any deviation is an error, even though "it's clear" to humans. I think that's something fundamental beginners need to learn, regardless of the language they use. But once you accept that there are rules to…

> struggle with the concept of syntax

I agree, and I think the problem you mention is a special case of the difficulty some people have to grasp the concept of definition in the mathematical sense.

Unlike "dictionary" definitions, they can be arbitrary: if I say "let S be the set of prime numbers greater than 13" you pretty much have to accept it, as long as it's well-formed and consistent.

On the other hand definitions need to be very precise. Natural language relies on "you know what I mean", which is a feature for most human-to-human communication, but it's not how mathematics and computer science work!

Re: Tcl the Misunderstood (2006)

#47
Overwhelming number of tcl positive comments here. Must be selection bias. Tcl is ridiculous. I propose that anyone who prefers tcl over other top languages in 2022 simply doesn't have productivity or teamwork as their top goal.

Do you want your language to help you solve real problems, or do you just enjoy your weird toy from another era? Everything is a string..? Please.

Re: Tcl the Misunderstood (2006)

#48
post #38
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…

I've seen beginners, especially those without a very strong maths background, struggle with the concept of syntax. The idea that you need to put the thing you want the program to do into a very specific form. That any deviation is an error, even though "it's clear" to humans. I think that's something fundamental beginners need to learn, regardless of the language they use. But once you accept that there are rules to…

When my mom was learning to program, she was annoyed that the computer did not recognize that "O" means zero, and "l" means one. Her old manual typewriter didn't have 0 and 1 keys. So her typing habit resulted in a lot of errors.

Later she taught programming. The first thing she told students was: "Computers are dumb. They will only do exactly what you tell them."

Re: Tcl the Misunderstood (2006)

#49
I've managed to work on two TCL codebases in my career, one in 1992ish, and one in 2011ish. I was very surprised to be working on it the second time! I've said it before, but working on TCL is interesting, kinda fun, and ultimately a lesson in frustration once you get to a certain sized codebase. It really hammered home the need for static typing as your repo gets over 50k lines because it is so "type free". However, it is a cool thought experiment for it's premise, which is more-or-less, "what if everything is a string". It has a lot of benefits, and a lot of nasty side effects. I'm glad I spent time doing it, and I think the use case for which it was made ("Tool Control" roughly speaking) it has good ideas. TK was fun, as well, I miss it in some ways. But ultimately, TCL is a dead end for a programming language - the negatives accumulate too quickly.

Re: Tcl the Misunderstood (2006)

#50
post #36
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…

The traditional answer was to use a BASIC dialect. Minimal syntax, minimal structure, simple imperative commands. A lot simpler than Pascal. I don’t know TCL very well, but its scope semantics may be confusing. I’d take a look at LOGO also.

I think the beauty of BASIC for teaching is that it's easy to "think like the computer," because the computer holds very little information other than the values of the variables that you used. For this reason things like loops are quite concrete.

Those who break past "the wall" and achieve any fluency at programming, can and will learn to start thinking in layered abstractions. And their programs will start to get bigger. Then it's time to move away from BASIC.

I moved to Pascal. Today, Python. But I agree with the above and about Python, that you are forced to handle abstractions, almost from the git-go. Perhaps what saves it is the ease of trying things, so if the functioning of a loop like "for i in range(10)" is confusing, just try it with a print() statement in there.

BASIC was also preferable on a timeshare machine. Waiting 10 seconds per line for a response seemed more tolerable than waiting 10 minutes for an entire program to compile and link.

Post reply on HN