- Back to Home »
- Seminar on Tool Command Language
Posted by : Unknown
Wednesday, December 18, 2013
Tool Command Language
Abstract of Tool Command Language
TCL/TKs
(Tool Command Language/Tool Kit) strength is that it is a small, interpreted,
language that can be embedded, access graphics and system features, and is
extensible. It also is multiplatform and has very wide support. It can be
downloaded on the NET, and it runs TCL scripts for backend processing. TCL is a
language, called the Tool Command Language. TK is a set of extensions or
"widgets"(the actual official designation) that happened to be
written by TCL's author to add graphic capability to his TCL interpreter they
include things like list boxes, entry boxes, radio buttons, check boxes,
etc.... In fact, prior to TCL/TK 8.0, TCL was at version 7.3, and TK was at
version 4, as I recall. In a way, TCL's relationship to TK is kind of like VBs
relationship to activex(which ALSO has controls as mentioned above, and are
sold as one package). In fact, a VB user can program for a long time without
realizing that he or she is using activex components all over the place.
Tcl
was originally intended to be a reusable command language. Its developers had
been creating a number of interactive tools, each requiring its own command
language. Since they were more interested in the tools themselves than the
command languages they would employ, these command languages were constructed
quickly, without regard to proper design.
After
implementing several such "quick-and-dirty" command languages and
experiencing problems with each one, they decided to concentrate on
implementing a general-purpose, robust command language that could easily be
integrated into new applications. Thus Tcl (Tool Command Language) was born
Introduction of Tool Command Language
The
Tcl scripting language grew out on design tools for integrated circuits at the
University of California at Berkeley in the early 1980's.
The
notion of embeddability is one of the most unique aspects of Tcl, and it led to
the following three overall goals for the language:
- The
language must be extensible : it must be very easy for each
application to add its own features to the basic features of the language,
and the application-specific features should appear natural, as if they
had been designed into the language from the start.
- The
language must be very simple and generic, so that it can work easily with
many different applications and so that it doesn't restrict the features
that applications can provide.
- Since
most of the interesting functionality will come from the application, the
primary purpose of the language is to integrate or "glue
together" the extensions. Thus the language must have good facilities
for integration.
The
conclusion that to reduce the resource requirements by building large systems
out of reusable components. If most of the complexity of a system was in the
components, and it could carry the components forward from system to system,
perhaps it could build large powerful systems .
The
additional resources provided by Sun make major improvements to Tcl and Tk.
Scott Stanton and Ray Johnson ported Tcl and Tk to Windows and the Macintosh,
so that Tcl became an outstanding cross-platform development environment;
today, more than two-thirds of Tcl downloads are for Windows
Grouping and Substitution :
The
Tcl syntax is used to guide the Tcl parser through three steps: argument
grouping, result substitution, and command dispatch.
- Argument
grouping. Tcl needs to determine how to organize the arguments to the
commands. In the simplest case, white space separates arguments. As stated
earlier, the quotation marks and braces syntax is used to group multiple
words into one argument. In the previous example, double quotation marks
are used to group a single argument to the puts command.
- Result
substitution. After the arguments are grouped, Tcl performs string
substitutions. Put simply, it replaces $foo with the value of the variable
foo , and it replaces bracketed commands with their result. That
substitutions are done after grouping is crucial. This sequence ensures
that unusual values do not complicate the structure of commands.
- Command
dispatch. After substitution, Tcl uses the command name as a key into
a dispatch table. It calls the C procedure identified in the table, and
the C procedure implements the command. You also can write command
procedures in Tcl. There are simple conventions about argument passing and
handling errors
Tcl
was not designed to be a serious programming language. It was designed to be a
"scripting language", on the assumption that a "scripting
language" need not try to be a real programming language. So Tcl doesn't
have the capabilities of one. It lacks arrays; it lacks structures from which
you can make linked lists. It fakes having numbers, which works, but has to be
slow. Tcl is ok for writing small programs, but when you push it beyond that,
it becomes insufficient