Tcl/Tks portability
The body of the article suggests writing two different scripts for wrapping ping under Unix and Windows, respectively. This is a mild hack to help make the explanation clear to those new to Tcl. In practice, Id always consolidate such code into such a unified script as:
... switch $::tcl_platform(platform) { unix { set repeat_flag -c } windows { set repeat_flag -n } } set fp [open "|ping $repeat_flag 5 tcl-tk.net"] ...
In fact, one of Tcls great virtues is its remarkable portability. This is import for C programmers in at least a couple of different ways. First, its common to use Tcl to mollify command-line programs with difficult interfaces. In this case, ping is generally available under both Windows and Unix, but with different options and displays. Tcl makes it easy to wrap up such variants so that end users need learn only a single interface, and probably a point-and-click one.
Also, Tcl makes a fine portable general-purpose application library. With Tcls powerful networking code, for instance, it takes only a dozen lines to write a capable TCP/IP server that works identically across MacOS, Unix, Windows, OpenVMS, and other operating systems. If you need project-specific low-level C code, combined with a general-purpose network service, Tcl provides a convenient solution.
There are plenty of other examples of such cooperation between Tcl and other languages, on a variety of different operating systems. Poorly-standardized C libraries often require us to stumble around with obscurely-defined #ifdefs. For Tcl, though, the standard documentation explicitly assures programmers they can use tcl_platform at run time to compensate for any operating system differences.