Practical Programming in Tcl & Tk
Author: Brent Welch
Publisher: Prentice Hall
Price: $42 US
Reviewer: John McLaughlin
If you are a Linux user, you have most likely used a Tcl/Tk application. A large number of the applications under Linux use Tcl/Tk (here after referred to as “Tcl applications”) as the GUI front end. Tcl has become popular under Linux for a variety of reasons: flexibility, ease of use, availability of source code, liberal license policy and the gorgeous look to the Tk widget set. If you're curious and want to learn more about Tcl or if you just want to become more comfortable with the language, Practical Programming in Tcl & Tk by Brent B. Welch is a book you'll want to read and refer to often.
A member of the development team for Tcl at Sun, Mr. Welch is perhaps best known to the Linux community for his work developing EXMH, the best mail reader under Linux (small personal bias inserted). In this 2nd revision of his book, he uses 613 pages to lead the user from the fundamental paradigm of Tcl scripts, to using Tk and writing extensions in C.
The book is divided into seven sections covering Tcl Basics, Advanced Tcl, Tk Basics, Tk Widgets, Tk Details, Tcl and C, and Changes. Each chapter begins first with a short paragraph introducing the subject, followed by detailed discussions, tables and a plethora of examples. A helpful feature of this book is the “Hot Tips” marked in the margins, these indicate something particularly useful, tricky or non-obvious.
The section on the Tcl language pleased me immensely; often books fly through the fundamentals of Tcl in order to get to the more “glamorous” Tk section. Tcl is powerful and rich, but can sometimes be a confusing language especially if you don't fully understand the fundamentals. The author's thorough explanation of the basic constructs and group-substitute-evaluate paradigm of the Tcl language was nicely done and clarified my understanding. Anyone who writes Tcl scripts would benefit from reading the first section a few times.
The sections on Tk widgets clearly explain not only the syntax and use of the widgets, but through the extensive use of examples really drive home how to most effectively use them. The book also discusses techniques on how to solve, in a simple manner, problems that face many Tk programmers (such as having a scroll bar attached to two listboxes).
The sections on the Tcl C API are very well done and excellent reading for anyone who is trying to integrate Tcl into a larger application. Not only does the author give a nice overview of the API from a task perspective; he also provides several tricks. My favorite is Tcl_Invoke a C procedure that allows the invocation of Tcl commands without the overhead of substations that come with Tcl_Eval.
Included with the book is a CD-ROM containing all of the examples from the book and a small browser application to help access and run the examples. Perhaps I am being a bit overly critical, but I was a little disappointed with the included browser application. It would have been nice to include a really glitzy Tcl browser to really show off the strengths of the language. Sadly, the included application, although usable, was a little stark and would certainly not inspire a new user of Tcl to get excited about the language. Also included were a collection of Tcl scripts and extensions from the various FTP sites; again it would have been nice if a few more of them had been unpacked and ready to run off the CD.
Although this book is described as being useful for the beginner, as well as expert Tcl user, it really shines for people with at least a little programming knowledge. In some ways the breadth and detail of the book (not to mention its weight) could be a little intimidating for a newcomer. For the true beginner I still like John Ousterhout's Tcl and the Tk Toolkit (although it's getting a bit dated).
Throughout the book the author pulls no punches. Covering the language in great detail and providing many useful tricks, he is equally quick to point out potential pitfalls, inefficient commands and constructs that although legal “probably aren't a good idea”.
A great amount of attention is spent throughout the book delineating features that apply to a specific release of Tcl or a specific computer platform (Unix, Windows, Mac). This is particularly helpful if you are interested in writing truly cross-platform scripts. Whenever possible, attention is given to writing code that will work across multiple platforms and revisions of Tcl. Because the author is part of the design team at Sun, he was able to cover some of the new features introduced in Tcl 8.0 including namespaces, binary string support and the on-the-fly compiler.
Without a doubt this book lives up to its name. It provides an extremely practical view of Tcl and Tk, pointing out its features and flaws while focusing on writing scripts that “get the job done.” Mr. Welch has written a book that is essential reading and reference material for anyone who writes Tcl code or integrates it into a larger application.
John McLaughlin is a project manager at Hewlett Packard working on test equipment for wireless chipsets. A Linux user since 0.99.13, he lives in the San Francisco Bay area with his wife Noel and enjoys traveling, diving, skiing, hacking with Tcl and writing EXMH extensions (under Linux of course). He can be reached at email@example.com.
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- The Firebird Project's Firebird Relational Database
- Stunnel Security for Oracle
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide