IMHO: Integration Platforms: The Missing Link in Enterprise Computing (Web Techniques, May 1999)


Tcl and Perl: A Brief History

By John Ousterhout

Scripting languages like Tcl and Perl have been used for integration tasks since the earliest days of computing. Even OS/360, a batch-processing system of the 1960s, provided a scripting language called Job Control Language. JCL was crude by today's scripting standards, but it was used for the integration tasks of the day, which consisted of sequencing job steps in a card deck and arranging for the flow of data between steps.

The UNIX operating system has a long tradition of outstanding scripting tools, and both Tcl and Perl have their origins in that tradition. The first UNIX scripting language was a shell program called "sh." It was used as the system command language and also allowed sequences of commands to be stored in files and executed as applications. The sh program made it easy to integrate collections of smaller programs into applications with powerful functions. This led to the development of numerous component programs; it has been one of the most distinctive and powerful features of UNIX. Over time, a series of more powerful shell programs evolved from sh, including csh, tcsh, ksh, and others.

Perl grew out of Larry Wall's experiences with UNIX. After years of writing shell scripts that used UNIX tools such as awk, grep, and sed, Larry decided that he could create a more powerful tool by integrating the features of all these programs into a single application and adding extra facilities as well. The result was Perl, which provides perhaps the richest set of text processing facilities available anywhere. Perl also integrated well with system facilities such as sockets, so it quickly became the tool of choice for system administrators. When the Web became popular in the early '90s, many of the first Webmasters were system administrators. They brought many of their favorite programming tools to this new arena, so Perl became popular for Web tasks such as CGI scripting.

Tcl was also inspired by the UNIX shells, but whereas a shell lives outside applications and is used to invoke them, I designed Tcl to be used inside applications. Tcl is a simple interpreted language implemented as a library package that can be linked into applications. Furthermore, Tcl is easily extensible. Each application adds its features into Tcl as new commands, creating a powerful command language that can be used to script the application. Shortly after writing Tcl, I also created an extension called Tk that allows graphical user interfaces to be created by writing Tcl scripts. Together, Tcl and Tk developed a reputation as the fastest and most powerful way to build GUIs. At the same time, application developers adopted Tcl as a good way to make their applications scriptable. Because of its embeddability and extensibility, Tcl has also become popular for a variety of integration or "gluing" tasks, ranging from factory automation to financial applications and programming for the Web.

The differences between Tcl and Perl stem from the differences between Larry's goals and mine. Larry's goal was to get all the tools he needed in one place and tightly integrated for maximum power. As a result, Perl is a larger language than Tcl; it has tons of built-in features, but it is more complicated and more difficult to learn. In contrast, my goal for Tcl was to make it easy to control functionality implemented outside Tcl. As a result, the Tcl language is simple and easy to learn, and it can be used in a remarkable number of different places for different tasks. Perl is most popular for text processing tasks such as report generation and CGI scripting. Tcl is most popular for automating processes and applications that were not previously programmable and integrating them with other resources; it is also a favorite for tasks involving GUIs.


Copyright © Web Techniques. All rights reserved.
Web Techniques Magazine