News for hackers. Stuff that matters.
Re:Espresso Machine Powered by Tcl/Tk by msla on Wednesday July 31, 2019 @12:26AM (#20571708)
Ideas about where Tcl went wrong:

https://utcc.utoronto.ca/~cks/space/blog/programming/WhereTC...

https://journal.dedasys.com/2010/03/30/where-tcl-and-tk-went...

... and discussion of the page immediately above:

https://news.ycombinator.com/item?id=3579088

Tcl does have a strange syntax. It tries to be "Lisp but with strings" and strings aren't even as easy to work with as what Lisp gives you, which are singly-linked lists of tokens and other singly-linked lists. And doing Lisp with other representations isn't that new: XSL is "Lisp but with XML", for example.

Re:Espresso Machine Powered by Tcl/Tk by _ph_ on Wednesday July 31, 2019 @09:29AM (#20574253)
I think the second link is a great read and I agree with most points. If Tk had been moved to GTK or QT (probably GTK due to licensing) early on, it could have maintained its role for making portable GUIs a bit clearer. Though, in my eyes, Tcl/Tk still is the easiest tool to use portable UIs. Especially with Tclkits, you can make single-file executables, which are very convenient to deplay, I have had great sucesses with that.

Today, Python has grabbed a lot of attention from Tcl - for "programming" it might be the more elegant language, but for "scripting" Tcl is hard to beat. But it is ironic that Python still ships Tkinter as the default GUI solution. If any language, Python should have standardized on GTK support, it had good support for GTK, but never standardized it.

The Tcl syntax is a bit rough, but is built on extremely simple rules. This has two benefits. First of all, it is - that was what it was designed for - a great language to control tools, that is, script complex programs. Thanks to the syntax, every function immediately becomes a command a user can type, no complex syntax for the input required. In that sense, like shell scripting, Tcl sacrifices a bit of syntax suger for the developer for a nice interactive input syntax. It is vastly nicer to program in compared to the shell languages :) The second benefit ist the ability to extend the language by the users - it doesn't even need a macro system for that like Lisp. Tcl is one of the few homoiconic languages.

Finally, while Tcl isn't as activelely maintained and especially extended as other "modern" languages are, this cuts in two directions. The implementation is extremely robust and many features are very efficient. Of course the basic execution speed of Tcl code is one of the slower scripting languages, but the libraries it uses are excellent. It had high performing event handling many years before Node.js made that populer.

Re:Espresso Machine Powered by Tcl/Tk by dmux on Tuesday August 06, 2019 @01:14PM (#20627267)
>Tcl is one of the few homoiconic languages.

I've been diving back into Scheme and one thing I found out was that in Scheme, procedures don't normally have an "external representation." I.e., once a procedure has been defined, I don't think there's a way to get that definition back out.

Tcl is really interesting in this aspect since procedure definitions (names, argument lists and bodies) can be viewed using the "info" command.

With that in mind, I'd say it's actually more homoiconic than Scheme.

Re:Espresso Machine Powered by Tcl/Tk by davidw on Wednesday July 31, 2019 @10:07AM (#20574512)
> I think the second link is a great read

Thanks!

Re:Espresso Machine Powered by Tcl/Tk by goatinaboat on Wednesday July 31, 2019 @08:59AM (#20574030)
Tcl does have a strange syntax.

It seems strange until you internalise the 12 rules, then it flows very naturally. There are none of the weird quirks you get in Ruby or Perl.

https://www.tcl.tk/man/tcl/TclCmd/Tcl.htm

Re:Espresso Machine Powered by Tcl/Tk by blacksqr on Wednesday July 31, 2019 @09:42AM (#20574334)
It's funny, I hear people talk and talk and talk about simplicity in programming, and see post after post about it on HN, and everybody seems to think it's a great idea, until it's staring them in the face.
Re:Espresso Machine Powered by Tcl/Tk by cmacleod4 on Monday August 05, 2019 @10:44AM (#20614592)
I think the issue is that what Tcl people think of as simplicity is for most people an uncomfortably-radical minimalism.
Re:Espresso Machine Powered by Tcl/Tk by blacksqr on Tuesday August 06, 2019 @07:47PM (#20630789)
Thus conscience does make cowards of us all, and thus the native hue of resolution is sicklied o'er with the pale cast of thought.