3 ms·
Tcl is bananas. On the one hand, its approach to structuring data (cram everything into strings, including procedures!) is... idiosyncratic and not what I'm use
by bitwize 8y ago
Tcl is bananas. On the one hand, its approach to structuring data (cram everything into strings, including procedures!) is... idiosyncratic and not what I'm used to. On the other, it seems to work hand in glove with the "Unix Way" (for whatever that's worth), and I've never seen a faster way to get a GUI up and running than Tcl/Tk. Not Visual Basic. Not even Smalltalk.
- blacksqr 8y ago"not what I'm used to" != "bananas"
- sshine 8y agoBut it is bananas. https://vanderburg.org/old_pages/Tcl/war/0018.html https://vanderburg.org/old_pages/Tcl/war/0018.html Tcl was my first language, and I enjoy it very much. But I hope I will never have to write anything serious in it. And I write Perl for a living.
- ofrzeta 8y agoIt's a bit idiosyncratic for sure. For one I always thought why the hell would you design a language and not use "=" as an assignment operator. On the other hand it's not a good reason to reject a programming language when it has a lot of other good features.
- sshine 8y ago> why the hell would you design a language and not use "=" as an assignment operator That never bothered me. One thing that bothered me was how hard it is to write Tcl code without errors. After the introduction of the special syntax {∗} in Tcl 8.5, correct list concatenation went from: set concatenation [eval [linsert $list1 0 list] [lrange $list2 0 end]] to: set concatenation [list {*}$list1 {*}$list2] Mind you, Tcl 8.5 is quite late in the history of the language, and the special syntax is still not super obvious. This example was taken from: https://stackoverflow.com/questions/5124185/what-does-do-in-tcl https://stackoverflow.com/questions/5124185/what-does-do-in-... Another thing that bothered me was the use of upvar/uplevel as a substitute for pass-by-reference: While upvar/uplevel is incredibly powerful (allowing you to evaluate code in any parent scope), this opens up for macros. The upside is super powerful macros. The downside is readers of your code will not know what's going on unless you stick to a set of conventions. I've experienced the same problem in syntactically saturated dialects of Lisp. Compare this to Scheme's 'hygienic macros': https://en.wikipedia.org/wiki/Hygienic_macro https://en.wikipedia.org/wiki/Hygienic_macro -- in Tcl, you can't look at an arbitrary piece of Tcl code and know anything about what's going to happen.
- ken 8y ago> why the hell would you design a language and not use "=" as an assignment operator That's one of my favorite things about Tcl. It just makes so much sense. Testing equality is analogous to testing inequality. It's a complex and context-dependent operation. Binding a value to a symbol is a completely different type of operation, and there's no reason for it to look similar. Keeping arithmetic in its own little space makes everything else so much simpler. Many of the most interesting new languages I've seen which don't come from the C/Unix school use something different for assignment, e.g., Factor (Forth), Clojure (Lisp), etc.
- tragomaskhalos 8y agoNor is it just the new kids - ":=" for assignment goes back to Pascal and Smalltalk (IIRC Smalltalk used a funky left arrow, like R but a single char, but also allowed := because who has a funky left arrow on their keyboard?)
- emmelaich 8y agoLike Lisp, one of the oldest languages ever?
- pwg 8y ago> On the one hand, its approach to structuring data (cram everything into strings, including procedures!) Tcl has not actually "crammed everything into strings" since circa. 1997 with the release of Tcl 8.0. Now, you can obtain a serialized string for most every data structure if you want one, and for quick serializing to a file or debugging this is useful. But the language has not operated solely with strings for everything for a very long time.
- 3rdAccount 8y agoRebol would like a word with you :) http://www.re-bol.com/rebol.html http://www.re-bol.com/rebol.html Makes Tk seem painful to me. There is a new "Red" language in the works to supercede Rebol and be a true full-stack language with an actual native GUI for each OS instead of the single Rebol GUI system which looks the same on every system.