Tcl and the Tk Toolkit
Author: John K. Osterhout
Reviewer: Phil Hughes
Tcl and Tk are receiving a lot of press. They offer a quick way to develop X applications or add a graphical front-end to existing code (see Linux Journal #8). Plus John Osterhout, the author of Tcl, is now working for Sun—and Sun is talking about turning Tcl into a serious product. In this book, Osterhout offers an introduction and overview of Tcl and Tk to get you started and continues on to the serious stuff.
The first part of the book following the introduction covers the Tcl language itself—chapters include syntax, variables, expressions, lists, flow of control, procedures, string manipulation, file access, processes and error handling—and ends with chapters on tcl internals and the history mechanism.
Next, the book covers the Tk toolkit for writing X-Windows applications. Again, there are a lot of chapters covering widgets, geometry managers, bindings, focus, window managers, communications between applications and invocation of procedures by real-world events. The final chapters discuss configuration, assorted commands and concepts that don't fit elsewhere and also give two applications examples.
The end of the book covers working with Tcl and C, and working with Tk and C. The Tcl chapters first tell you why you may want to combine Tcl with C and then explain how the interface works and how to develop code using it. There are a liberal number of examples. The Tk and C chapters thoroughly cover the nitty-gritty of the Tk/X interface. If you are not familiar with X-Windows programming, this looks a little scary, but it isn't the fault of Tcl/Tk.
The book ends with an appendix that points you at ftp sites where you can get software and a brief description of how to get it running. There are 450 pages of information contained in the book.
I am not a Tcl/Tk programmer and got the book to start from scratch. When I first looked at the book it reminded me a lot of The C Programming Language written by Kernighan and Ritchie (K&R), who also wrote the C language. Osterhout's book, like K&R's, begins with an overview and then continues by showing the reader all the details. A “hello world” program is used early on as a programming example and this illustrates that both Tcl and C are relatively simple languages. Also of note, is that Brian Kernighan is Addison-Wesley's consulting editor for a series of books.
I remember reading K&R, writing some C code, being a little frustrated, going back, learning more and eventually learning C. When I was learning C (1980) K&R was the only book out there. Today, even though there are hundreds of books on C, I still use K&R for reference and don't look in other C texts for information.
I have played a little with Tcl/Tk using this book and have felt more than a little frustrated. After looking over the book again, my conclusion is that it covers the language in detail as a tutorial, but it is not a good reference book. In the case of C, I use SSC's C Library Reference (a pocket-sized guide that I wrote) as a quick reference. Then I use K&R for additional reference, if needed, because it offers information in an easy-to-find format.
Osterhout's book isn't going to be the book you use when you are writing code and need to look something up. I see it as one of the tools you utilize to get started with Tcl/Tk, but a second, smaller book or pocket guide is necessary to help you with the nuts and bolts as you actually do development. Is it worth buying? Yes. But life will be easier when a reference exists that will complement this book.
Phil Hughes is the publisher of Linux Journal.
|illusive networks' Deceptions Everywhere||Aug 29, 2016|
|Happy Birthday Linux||Aug 25, 2016|
|ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs||Aug 24, 2016|
|Updates from LinuxCon and ContainerCon, Toronto, August 2016||Aug 23, 2016|
|NVMe over Fabrics Support Coming to the Linux 4.8 Kernel||Aug 22, 2016|
|What I Wish I’d Known When I Was an Embedded Linux Newbie||Aug 18, 2016|
- illusive networks' Deceptions Everywhere
- Happy Birthday Linux
- New Version of GParted
- What I Wish I’d Known When I Was an Embedded Linux Newbie
- All about printf
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Updates from LinuxCon and ContainerCon, Toronto, August 2016
- ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs
- Blender for Visual Effects
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