this post was submitted on 10 Sep 2025
500 points (98.1% liked)
Programmer Humor
26237 readers
2108 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I opened a TCL script once. It’s use of
uplevel
scared me. I’ve never dared to return since.For those who don’t know:
uplevel
is a command that goes up one level of the stack frame, and then executes code there. A function can therefore execute code in its callers stack frame.tcl is pretty fun actually, it's like bash on steroids.
for a preview of the insanity: anything surrounded by
""
is a string, with the variable expansion you'd expect. anything surrounded by{}
is also a string, but with no expansion. the equivalent in bash is the backtick string. but you don't need to know that to write tcl. if you approach{}
as "code blocks" like in other languages, it just works. reason being that tcleval
s everything, constantly, attaching little tags to strings that tells the language how things are used, like "this string is an integer" or "this string is code and here is the result from last time it ran". it's madness and, weirdly, robust as hell. Xilinx writes all their tooling in tcl. SQLite started life as a tcl module, and it's still the only api that is not provided by a plugin.