Slashdot Mirror


Tcl/Tk 8.5.0 Released

dkf writes "Tcl/Tk 8.5 has been released for all major platforms after 5 years of development. There are many new goodies in it, including significant speedups through an advanced bytecode engine, stronger localization of applications, integrated arbitrary-precision arithmetic, a whole bunch of brand new skinnable widgets, anti-aliased text support on all platforms, and a new code-module management system to make maintenance of installations a snap. More in-depth information about the features of both this release and Tcl/Tk in general is available at the official Tcl/Tk website. Mark Roseman's blog has a first-look review."

29 of 148 comments (clear)

  1. Re:Great news by jd · · Score: 5, Funny

    Yeah, but coders who prefer other languages might be tk'ed off.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  2. Tcl language vs. Tcl environment by ElMiguel · · Score: 3, Interesting

    From what I've seen, the internals of the Tcl environment (the interpreter, libraries and so on) are pretty solid and nicely done. Unfortunately the Tcl language itself is peculiar, dated and just not very good. I wish the Tcl people would consider a thorough backward-incompatible revamp of the language into something a bit less off-putting.

    1. Re:Tcl language vs. Tcl environment by Minix · · Score: 3, Interesting

      Tcl's internals are well done, and the QA is exemplary - a Tcl alpha is as good as anybody else's beta.

      I've noticed that some people don't like Tcl as a language, but can't personally understand why. Tcl seems to be a favorite of a lot of well experienced people who can make it stand up and sing.

      I used to think that Tcl-aversion was due to extreme syntactic simplicity, but now I think the simplicity is deceptive, and Tcl is just too hard for some programmers: you need a deep stack to write Tcl well.

      --
      "There are four boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order." Ed Howdershelt
    2. Re:Tcl language vs. Tcl environment by Minix · · Score: 2, Informative

      Eval isn't as necessary since the new {*} syntactic element was added.

      Unfamiliar syntax - every syntax is unfamiliar until you're familiar with it.

      I don't find []-as-command-substitution-operator too vexing. If you have a syntax-aware editor. It's almost as expressive as lisp, but with less of the nesting hell.

      Upvar/Uplevel are <b>fantastic</b> when you understand what they're used for. Uplevel enables tcl to be completely extensible - you can write new tcl language elements within tcl. For example, one can write a brand new <i>transaction</i> command which wraps its contents in a db transaction open/close pair, and catches errors to abort transactions. I really miss that when I have to code in other languages.

      Tcl isn't for everyone. You need to be able to remember the difference between a function application, a quoted and an unquoted string. There are precisely 13 syntactic rules. It's surprising how many peoples' brains just don't work that way.

      --
      "There are four boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order." Ed Howdershelt
    3. Re:Tcl language vs. Tcl environment by Minix · · Score: 2, Informative

      When I worked with Tcl I was still just learning to really think like a developer and understand the process on top of learning Tcl, which really is a fairly complicated language. I'm sure I would have far less trouble with it now that I've got a few years of full time, non-hobby development under my belt but I don't see any reason that I'd want to use it and find out.
      Perhaps to see if you're missing something? It's significant that a lot of Tclers are old and battle-hardened. Perhaps there's something of enduring value to be found in Tcl, but it takes a while to recognise. Your problem with lists, yeah, perhaps your problem is Quoting Hell? It can be easily avoided with simple good habits, but you have to learn them first.
      --
      "There are four boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order." Ed Howdershelt
    4. Re:Tcl language vs. Tcl environment by ConceptJunkie · · Score: 2, Insightful

      Really, no one seems to think Perl is "peculiar", when it's practically a write-only language, pre-obfuscated for your convenience. Tcl is incredibly simple once you understand it.

      --
      You are in a maze of twisty little passages, all alike.
    5. Re:Tcl language vs. Tcl environment by nuzak · · Score: 2, Interesting

      > Tcl is incredibly simple once you understand it.

      I've never seen a language that actually parses comments, the way Tcl does. There's nothing simple about that.

      --
      Done with slashdot, done with nerds, getting a life.
    6. Re:Tcl language vs. Tcl environment by ElMiguel · · Score: 3, Insightful

      For what is worth, a lot of experienced people are fans of obscure antique technologies, because that's what they specialized on and they don't want to learn some "new-fangled" substitute from the start. There's still people that swear by VMS, it's just human nature.

      As for what I don't like about the Tcl language, it's mostly just a collection of small things, such as:

      • Operators can only be used if you have an implicit or explicit expr, and no assignment operators. You've got "set" and "incr", but it isn't as readable. Using "$" for variable substitutions but not for variable references is also not very readable.
      • Loads of naming inconsistencies. Just in the predefined commands, you've got words together with no separations ("msgcat"), words together separated by underscores ("auto_load"), mixed case *and* underscores ("tcl_endOfWord"), double colons ("pkg::create"). Then, string operations are grouped together in the "string" command, but you've got separate commands for list operations.
      • The -something options are ugly, in addition to a potential gotcha, because if you have something like "switch $var" everything will work fine until the content of var is, say, "-glob".
      • The "everything can be treated as a string" philosophy sometimes leads to strange results if your program logic has errors. I quite often had to use trial and error to fix this sort of problems.
    7. Re:Tcl language vs. Tcl environment by belmolis · · Score: 2, Insightful

      a lot of experienced people are fans of obscure antique technologies, because that's what they specialized on and they don't want to learn some "new-fangled" substitute from the start.

      That is true, but I don't think that it explains the popularity of Tcl within the Tcl community. There are plenty of people who have come to Tcl recently after long experience with other languages. I am one of them. I started programming in Fortran, on punch cards, in 1973. I first used Tcl in 2003, at which point I used mostly C, AWK, and Python. My initial reason for using Tcl was that I needed to write a GUI, had done no graphics programming for quite some time, and had heard that Tcl/Tk was good. I tried it, and indeed my initial reaction was that Tk was really nice but that for programs of some complexity I didn't really like Tcl. With greater experience, though, Tcl grew on me, to the point that it has almost completely replaced both AWK and Python.

  3. less and less by m2943 · · Score: 3, Informative

    Tkinter is the de-facto python windowing kit.

    I think Gtk is becoming more and more the "de-facto python windowing kit", in particular as Gtk's cross platform support is improving.

    1. Re:less and less by kripkenstein · · Score: 2, Interesting

      Tkinter is the de-facto python windowing kit.

      I think Gtk is becoming more and more the "de-facto python windowing kit", in particular as Gtk's cross platform support is improving. Well, the GP is probably basing that claim on that Tkinter is included in Python. Which has made it a sort of default for quick-and-dirty GUI hacking, especially cross-platform.

      However, you are correct about GTK. While there are other alternatives - WxWidgets and Qt both have nice Python bindings - PyGtk seems to be the nicest and most popular, and for good reason, it is an excellent platform. In fact GObject in C (or even C++, via gtkmm) seems clunky after you see how nicely GObject maps into Python classes in PyGtk. Add to that the fact that all major Linux distros include GNOME by default, and that Ubuntu in particular favors GNOME and Python, and you have quite a lot of people coding in PyGtk.
    2. Re:less and less by baxissimo · · Score: 3, Insightful

      I know this is Slashdot but there are still a few people out there using Windows, y'know. And GTK on Windows is just so-so at best. It looks and acts un-natural. Don't know about Mac, but I suspect wx is ahead of GTK in terms of not sticking out like a sore thumb there too.

    3. Re:less and less by cronot · · Score: 2, Informative

      That's because GTK and WxWidgets are not really on the same league. GTK implements a full Widget engine, as in it does all the job of actually drawing all the widgets. WxWidgets is not really a Widget engine per se, just a wrapper around the underlying platform's own native widget engine - that's why cross-platform applications written using wxWidgets has a native look and feel to them. In the case of Linux, wx wraps around GTK, since there's isn't a standardized widget engine for X11 applications (though IIRC Wx has or had QT bindings too).

      That's not to say I dislike WxWidgets though, to the contrary - I always turn to it when I need cross-platform GUI apps, it is sweet, and it is sad that it has so little recognition, and poorer approaches to the solution are used instead (GTK / QT).

  4. Will Tk Widgets Now Integrate? by RAMMS+EIN · · Score: 2, Interesting

    I am only interested in one thing:

    Will the Tk widgets now integrate with the rest of the desktop, in terms of using the same theme settings that other programs use?

    I like how Tk has been used as a GUI toolkit by many programming lanugages, and I think that says something good about its design and implementation, but the ugly, unthemeable, and out-of-place looking widgets have always been a thorn in my eye.

    Especially because it _did_ work sort of right on proprietary OSes as far as I know.

    --
    Please correct me if I got my facts wrong.
    1. Re:Will Tk Widgets Now Integrate? by BiggerIsBetter · · Score: 4, Informative

      Will the Tk widgets now integrate with the rest of the desktop, in terms of using the same theme settings that other programs use?

      Yes

      --
      Forget thrust, drag, lift and weight. Airplanes fly because of money.
    2. Re:Will Tk Widgets Now Integrate? by zlogic · · Score: 2, Informative

      It works well with MacOS X and Windows, but what about Linux? Most Linux apps use GTK, or gtk bindings to some other language, or the GTK theme (like Swing in Java 6). And these screenshots show nothing more than a nicer theme on Linux. And no font antialiasing or hinting!

  5. Re:They need to start releasing... by Eryq · · Score: 5, Insightful

    Why Java won that market I can't possibly fathom.

    It didn't. Flash did.

    Java might have won if the original JDK hadn't been so primitive and difficult to work with. Even long after Swing was released, browsers were still shipping with ancient 1.1 JVMs, and installing newer JVMs wasn't an automatic (or even simple) process for some browsers and platforms.

    Still, though, Flash probably would have won out in the end. Swing is designed for desktop applications: standard menubars, dialogs, etc. -- themeable, maybe, but BORING to a web designer's eyes. With Flash, cool weird unique user interfaces are the whole point.

    The engineer and UI-standards-advocate in me appreciates Swing. The artist wants to learn Flash.

    --
    I'm a bloodsucking fiend! Look at my outfit!
  6. Tcl language vs. Tcl environment-Bling. by Anonymous Coward · · Score: 3, Funny

    "Really? For what purpose?"

    Bragging.

  7. Re:I'm a big Tcl/Tk Fan, but... by stevel6868 · · Score: 5, Informative

    Tcl is too stable for many who think the bleeding edge is cool, and too different for those who think C is the pinnacle of language design - so it's left to a large number of people who just get on with using it because it works. Of course, if you're not interested in cross-platform GUIs, event driven I/O, Internationalization, extensibility, portability, rapid prototyping, easy interfacing to C and other languages and automated test environments then perhaps Tcl isn't for you.

  8. Re:Great news by Minix · · Score: 5, Informative

    There's some great new stuff for Tcl in this release. Built-in dict type http://wiki.tcl.tk/dict, Functional Application http://wiki.tcl.tk/apply, built-in arbitrary precision integers http://wiki.tcl.tk/10942, at last a sanctioned OO framework http://wiki.tcl.tk/TclOO.

    New Tk looks beautiful.

    Tcl runs webservers, robotic manufacturing equipment, and even monitors spacecraft. Odds are that you have probably used a Tcl/Tk application and never even knew it. (If you've watched NBC since 1998, you've seen the results of a Tcl application on screen.)

    I'm an unabashed Tcl fanboy, and this release is great.

    --
    "There are four boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order." Ed Howdershelt
  9. Re:I'm a big Tcl/Tk Fan, but... by Minix · · Score: 3, Informative

    Here are some detailed, relevant links:

    Cross platform: http://wiki.tcl.tk/1110

    Events: http://wiki.tcl.tk/3448

    Internationalization: http://wiki.tcl.tk/6789

    Easy C interface: http://wiki.tcl.tk/2523

    Oh, did I mention a thriving wiki? http://wiki.tcl.tk/

    --
    "There are four boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order." Ed Howdershelt
  10. Re:Tcl 9 by kennykb · · Score: 2, Informative

    The policy is that major version is bumped only when significant backward incompatibility is expected. New features don't do it unless they break old code.

  11. Re:It's not necessary anymore by BridgeBum · · Score: 4, Interesting

    TCL is still used in some surprising places. A good example is networking equipment, such as Cisco devices, F5 load balancers, and so on. Many of these have TCL capabilities for one reason or another. A good example for the Cisco case would be their load balancing devices. You can create custom monitoring scripts in TCL and import them into the device.

    --
    My UID is the product of 2 primes.
  12. It's Pronounced Tickle by dabbaking · · Score: 2, Funny

    Apparently Tcl is pronounced 'Tickle'. I learned the hard way after someone had pointed out that I named a file test.tcl.

  13. Re:Great news by nuzak · · Score: 2, Informative

    > at last a sanctioned OO framework http://wiki.tcl.tk/TclOO.

    Fantastic indeed, and the syntax looks nice. But you still have to manually destroy objects. Basically, writing Tcl like any other high level language in existence means having crippling memory leaks. So you learn to avoid objects like the bolted-on kludge that they still are. Even perl at least got the memory management part right.

    Python tkinter ought to look nice, but Tcl continues to be a non-starter.

    --
    Done with slashdot, done with nerds, getting a life.
  14. Re:It's not necessary anymore by 198348726583297634 · · Score: 4, Insightful

    Not so.

    Tcl's strongest redeeming features are its consistency and its sensibility. Tcl very strongly has a principle of least surprise, thanks to these. That alone makes programming in Tcl a joy compared with many, many other things. You'll spend a lot less time wondering how your code will work on a foreign platform, which flags a given widget expects, and so on.

    Tcl of 2007 is also not Ousterhout's Tcl of 1987. A lot has happened in the last 20 years, including totally pervasive unicode support (the [msgcat] library makes internationalization such a breeze, there's absolutely no reason not to make all your programs localizable from the start), some very healthy namespace functionality, an excellent networking library, and of course the relatively recent Tile toolkit.

    There are also new projects being developed with Tcl all the time.

    Far from being an outdated or dying language, Tcl today is just a well-kept secret, sitting out in plain sight.

  15. TCL/TK runs speech research by Latent+Heat · · Score: 3, Informative
    The WaveSurfer speech waveform analysis (pitch, formants, sound spectrogram) package is based on TCL/TK and has Python hooks. This is the free speech package out of KTH is Sweden. It is not my package, by the way so I am not shilling for it, but I have taken an in depth look at it to see how they get to be multi-platform and not Windows-bound.

    I think there may be one other speech analysis package that did spectrograms and used TCL/TK at one point, but I don't think it has an active distribution the way WaveSurfer does.

    What the WaveSurfer people did is that about half their code base is C-language for implementing speech-specific TK widgets, such as a spectrogram Canvas elaboration of the TK Canvas widget. Their C-language routines call down to low-level X to draw things, and if you build on Windows you need some implementation of X. The WaveSurfer Windows distribution, however, is a single .exe file that has WaveSurfer and whatever support libraries all rolled in, so there is a very simply install.

    Their TCL part, however, is a big ball of goo, or at least to someone who doesn't know TCL. Instead of pushing a lot of the functionality into the speech toolkit widgits, they implement a lot of stuff in the TCL layer -- it is not simply a thin scripting layer over a largely C code base. You find that out when you try to customize your own speech app using their speech widgets -- there is tons of functionality that you need to reproduce in your own app as the widgets are pretty bare bones. Not that there is anything wrong with it, but using the WaveSurfer app and hearing about rolling-your-own speech app with their toolkit, you kind of get the wrong impression about how much is in the widgets. I found this out when playing with Python scripting to display their widgets.

    The one thing that appeals to me about TK is the Canvas widget, which was apparently inspired by someone's Scheme graphics or some such thing. No worrying about paint messages and invalid regions -- you just give the Canvas a scene graph of line, text, even 3-color bitmap or even overlaying buttons, and the Canvas takes care of all of that. I would like to see such a high-function widget in other environements.

    I was never bothered by the non-Windows look to WaveSurfer (OK, the lame Files Open dialog of GTK under Windows bothers me, but not most stuff as Windows is not that uniform a GUI experience to begin with).

  16. TCL/TK was "Java" before there was Java by Latent+Heat · · Score: 2, Interesting
    The funny thing is that TCL/TK was what Sun was promoting before they came out with Java and started pushing that.

    Whenever you have one of these overlapping-window GUI front-ends to an OS, developing apps for it is a hard slog, whether it is Windows, GTK, Motif, raw X, whatever. Just like MS came out with their application programmer-friendly Visual Basic as the go-to way of slapping a GUI together, Sun was at one time promoting TCL/TK as the way of slapping a GUI front end on your C program.

    In commercial apps, your users worry if your widgets are pretty and Mac people are in a huff about ported software or Java not conforming to UI standard, but for internal apps that just have to get a job done, you often don't care. The projected associated with a high-voltage custom x-ray machine had been a Sun shop since the days Sun 2's came out, and the current app running the x-ray machine is TCL/TK running on a SPARC.

    That app makes good use of the Canvas widget to display gray-scale x-ray images and allow you to drag cursors and place measurement markers over those images; apart from that the app is a bunch of buttons to start and stop image collection and motion tracking modes of the x-ray system. I wouldn't have taken note that it was TCL/TK it it were not pointed out, but now that I know, I can see the characteristic widget styles and layouts along with the Canvas that does the x-ray images.

    Given that this was all implemented prior to the release of Java, TCL/TK is what you had, and TCL/TK is what you did unless you wanted to take much more time doing the GUI, and our app has aged well (although try hiring someone to change the TCL code), so yes, it is a good question why Sun in effect abandoned that and jumped on the Java bandwagon of their making.

  17. Next Coccinella will switch to 8.5 in a few months by ghfttjj124 · · Score: 2, Informative

    Just some side information. I read Coccinella will already switch to Tcl/Tk 8.5 in a few months (12 March). See comment at the end of the announcement of the latest release: http://coccinella.im/coccinella-0.96.4 Oh yes, and Coccinella is already using an older version of Tile for Tcl/Tk 8.4. This is some sexy theme proof that Tcl/Tk shouldn't be ugly: http://coccinella.im/stuff/sexy.png