Chapter 14: Network Programming in Tcl

 < Day Day Up > 



Tcl Language Overview

In this chapter, we investigate network programming in the popular scripting language Tcl (otherwise known as the Tool Command Language). Tcl is an interpreted language that was originally designed to be embedded within applications written in other languages (such as C). In addition to its use as an embedded scripting language, Tcl can be used by itself with the simple interpreter. Tcl is both simple and powerful and finds itself in many diverse application areas. All code for this chapter can be found on the companion CD-ROM at /software/ch14.

Origin of the Tcl Language

The motivation for creating Tcl was the need for an extension language for hardware design tools at the University of California at Berkeley. In 1990, John Ousterhout observed that some of the power behind Unix and the Emacs editor was that they could be extended by the presence of a programmable command language (shells for Unix and LISP for Emacs) [Ousterhout90]. Rather than create a new language for each design tool that was developed, Tcl provided a library that permitted the tool to be extended (thus the name, Tool Command Language).

Tcl Language Heritage

What makes Tcl most interesting is that it exists as a set of libraries that can be integrated into another application to extend it for scripting capabilities. The Tcl library includes not only the interpreter, but also a set of built-in commands and the ability to extend the language with new commands that are first class (appear as part of the original language).

Tcl has numerous influences that extend beyond the realm of computer languages. One of the major influences on Tcl was the Emacs editor. Emacs is not so much an editor as it is a development environment (a precursor to many Integrated Development Environments, or IDEs, of today). Emacs provided a built-in scripting language to allow users to script capabilities within the editor using LISP. This made Emacs not only extendable, but also very powerful. Tcl also borrowed some aspects of LISP, but also reversed some aspects from LISP such as how expressions are evaluated. Tcl is also similar to the NeWS window system that is based upon the Postscript language. Tcl provides a mechanism to send scripts to a server for execution, similar to NeWS Postscript generation capabilities.



 < Day Day Up > 



BSD Sockets Programming from a Multi-Language Perspective
Network Programming for Microsoft Windows , Second Edition (Microsoft Programming Series)
ISBN: 1584502681
EAN: 2147483647
Year: 2003
Pages: 225
Authors: Jim Ohlund

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net