5 ms·
Where Tcl and Tk Went Wrong
- Aegean 17y agoTo summarize in two words: Its ugly. Tcl syntax is ugly, tk GUI's are ugly and look old. Also, Python is the winner for me because it's syntax resembles C but is a lot easier to write.
- davidw 17y agoWas old and ugly. It's getting better, but that doesn't matter, because people are firmly convinced that it is old and ugly, no matter what the developers have been up to. This is precisely the sort of marketing problem I'm referring to: once you create an impression in people's minds, it takes a hell of a lot of work to correct it, even if the actual problem has largely gone away. The impression remains... > > Lately, there has been a lot of work to update the Tk look and feel, and it has finally started to bear fruit. However, in terms of marketing, the damage has already been done: the image of "old, crufty Tk" has been firmly planted in countless developers' minds, and no amount of facts are going to displace it in the near future. > Also, Python is the winner for me because it's syntax resembles C but is a lot easier to write. Yes, I covered that aspect too: > > The syntax, for your average programmer who doesn't want to go too far out of their comfort zone, is perhaps a little bit further afield from the C family of languages than they would prefer. Still though, a "human" problem, rather than a technical one. Perhaps, sadly, the message is that you'd better not "scare" people when introducing a new language, by showing people something that doesn't look at least a little bit familiar. You are apparently one of the many who is a bit scared/confused/whatever by a seed that has fallen a bit farther from the C tree. As far as the syntax, Tcl is quite elegant, in reality, once you take the time to understand it (which is not much time, as it's also very simple).
- jkkramer 17y agoIf Tk doesn't look old and crufty anymore, you wouldn't know it from the official website: there are no screenshots to be found. I spent five minutes trying to see what a modern Tk GUI looks like then gave up.
- gaius 17y agohttp://www.tkdocs.com/ http://www.tkdocs.com/
- makmanalp 17y agoNice screenshots of good looking Tk applications. http://www.tkdocs.com/gallery/index.html http://www.tkdocs.com/gallery/index.html
- lylejohnson 17y agoAs noted elsewhere, there is (currently) one tiny screenshot on that page, and nothing else.
- GeneralMaximus 17y agoGoogling the two applications they listed, I get http://thecoccinella.org/gallery http://thecoccinella.org/gallery and http://sourceforge.net/project/screenshots.php?group_id=190798 http://sourceforge.net/project/screenshots.php?group_id=1907....
- aidenn0 17y agoAh yes, this is another problem. I hope things are better now, but I was writing a UI a while back, and the TK documentation was like this: tcl.tk had a 1 line description of every command that's not really useful, and tkdocs.com was missing documentation for half the widgets!
- davidw 17y agoI was responsible for kicking off the effort to include this in the documentation: http://www.tcl.tk/man/tcl/tutorial/tcltutorial.html http://www.tcl.tk/man/tcl/tutorial/tcltutorial.html Most of the actual material is Clif Flynt's though. It's not perfect, but at least it's a starting point that's widely visible to people getting going with the language. And, of course, it's Tcl, whereas you're asking about Tk. Definitely something that would have been useful.
- aidenn0 17y agoThis is true. I was starting work on a cross platform project with a friend. The question of which GUI toolkit to use came up. He wanted to use QT, I wanted to use TK. I had to show him a recent TK project of mine before he would believe that TK wasn't ugly on X11.
- antirez 17y agoActually if you look at the syntax from a mathematical point of view, Tcl synax is much simpler. Also behind the clean Python look (that almost seems pseudo code in simple programs) the Python semantic is really complex compared to the one of Ruby for instance.
- gaius 17y agoYep, the 12 rules and that's all there is to the language. Tcl is really well designed and elegant. It's almost a Lisp, but one that has the libraries and installed base that it can be used for production work. e.g. it's easy to add your own control structures to the language
- swannodette 17y ago>It's almost a Lisp, but one that has the libraries and installed base that it can be used for production work. >e.g. it's easy to add your own control structures to the language Huh? You obviously don't know Lisp. Between PLT Scheme and Common Lisp you have several metric tons of libraries. And Common Lisp is certainly used for serious production work. And finally, Lisp like freaking invented adding your own control structures to the language.
- gaius 17y agoYes, 50 years ago Lisp was 30 years ahead of everyone else. Things have moved on, tho'.
- swannodette 17y agoI've used more than few languages professionally or academically (C, C++, Objective-C, Java, JavaScript, Python, Scheme) and it still seems to me that most languages are still trying to catch up. This isn't to say I don't enjoy these languages. But to say that things have moved past Lisp, that's laughable really. I mean, I don't even have garbage collection on my iPhone (and I really dig Objective-C).
- joshu 17y agoI remember thinking of learning Tcl for a project. I bought a book (this was practically pre-web) and very early on it said not to use arrays, as they were O(n) access time. So I gave up.
- davidw 17y ago"arrays" are hash tables. You'd use the built in lists where you'd use an array in C. In 8.5, Tcl has "real", first class hash tables, "dicts", which, as I mention in the article, took too long to show up in the language.
- sfk 17y agoTk has native "look and feel". I've written a Python Tkinter app and I was pleasantly surprised how good it looks on Windows.
- chipsy 17y agoTcl is one that I kind of want to learn but can't find any excuse for. I came to the party too late, I guess - Python does just as well for my scripting tasks, and "EIAS" scares me away from trying it for a substantial application.
- davidw 17y agoThe EIAS thing is not really that bad in practice, since you get lists and hashes and numbers, which can be used to build a whole lot of things. You also have namespaces to help organize code, and an OO system is on the way. The things that come to mind where Tcl might be worth trying as opposed to Python are fairly niche: * Tcl still handles threads a bit better than Python, IMO. * "Starkits" are kind of cool if you want to distribute a single executable. Don't know what Python has in that department or how easy it is to use. http://wiki.tcl.tk/3661 http://wiki.tcl.tk/3661 . To tell the truth, though, "distributing" a web app is way easier than even starkits. * Tcl, for some things, might still make a better "embedded" language because of its extensive C API. That said though, Tcl isn't too different in its "ecological niche" from Python/Ruby/Perl, so I think if you know one of those, you'd probably be better off with something "further afield" like Erlang or Scala. BTW, some shoots off the Tcl tree are worth looking at if you want to play around with a relatively smaller codebase: antirez' Jim Interpreter, at http://jim.berlios.de/ http://jim.berlios.de/ and my own Hecl, at http://www.hecl.org http://www.hecl.org
- forinti 17y agoI my experience, Tcl\Tk is the easiest way to make a small executable app with GUI. You can execute the script in most Linux/Unix platforms and make an .EXE for windows with no effort at all.
- sutro 17y agoA very well-written, thoughtful analysis, relevant to all languages and to the high-tech hype cycle in general.
- swannodette 17y agoI read the article more as "Things to consider if you don't want to run your really great technology into the ground". It shows how a community that has a great thing can sit on it's laurels and let the rest of the world pass them by. It happened to Common Lisp. I personally think PLT Scheme rebooting itself as Racket is just the kind of break-with-the-past mentality more projects should embrace.
- antirez 17y agoBtw, I would like to introduce this very related argument at this point. At some point Redis will get scripting. It will take time, we are just entering 2.0 feature freeze, and later the priority will be redis-cluster, but we'll get scripting soon or later probably. Now I happen to be the original author of Jim, a small embeddable but fast enough (using an objects specialization technique) Tcl implementation. It's just a single .c file with 10k lines of C that is albe to run many Tcl programs unmodified if they don't tak with the "outside world" (that is no files, no sockets, no everything). It is really designed to be embedded, check it here: http://repo.or.cz/w/jimtcl.git http://repo.or.cz/w/jimtcl.git Jim Tcl is actively developed, and used in OpenOCD (http://www.amontec.com/openocd/doc/About-JIM_002dTcl.html http://www.amontec.com/openocd/doc/About-JIM_002dTcl.html), in eCos environments and so forth. But what I think is that users may get upset if I don't use a different language. The problem is, I don't know any single-c-file easy to embed, fast enough, interpreter for a language that will be more welcomed (I would like Javascript, for instance). Also Tcl happens to be perfect to write Redis scripts, as they will look like commands issued with the redis-cli, like that: register-command GETDEL key { set result [GET $key] DEL $key bulk-reply $result } I wonder what will happen, if I'll go ahead or if there will be an alternative. I can't see how Lua is more elegant or better than Tcl, and while not hard to embed definitely not as simple and self-contained as Jim Tcl is. Also Lua is far from being a well known language. I really think that the right thing to do is to embed Jim Tcl, but there is a cultural barrier preventing me from doing this. Btw, Lua is absolutely the best among all the JS / Ruby / Python / ... implementation I saw. Without configure, and with a "Make ansi" target that is suitable to be used with the zero-configuration environment of Redis. So actually if it will not be Jim, it will probably be Lua.
- moe 17y agoFirst off let me say that I think this deserves a dedicated discussion on the mailing list or even on HN. I fear this thread will not be seen by most redis users, unless they also happen to be interested in TCL (selection bias). However: I really think that the right thing to do is to embed Jim Tcl, but there is a cultural barrier preventing me from doing this. My datapoint as a happy redis user would be: Please don't. I have used TCL but don't like it. I also think there are rather few users who are versed in it and the obscure syntax would become a barrier to redis scripting gaining popularity. My vote absolutely goes to Lua. That's still nowhere near as popular as javascript, python, ruby et al. But I think it's a much more accessible choice to people coming from the aforementioned languages (read: most people).
- mansr 17y agoMy main issue with tcl is the "everything is a string" approach and the resulting quoting hell.
- xtho 17y agoWith respect to the language: having strings as the only data structure (everything is a string) and the developers stance on OOP (we don't need that) didn't help either and made way for python & ruby. With respect to the WWW, there was ACS/OpenACS, which even the author doesn't mention.