Welcome to the Dictionary of Programming Languages, a compendium
of computer coding methods assembled to provide information and
aid your appreciation for computer science history.
Browse the dictionary by clicking on a section:
A
B
C
D
E
F
G
H
I
JK
L
M
N
O
P
QR
S
T
UV
WXYZ+
Get a full dump of the dictionary:
List of Names
Short Form
Full Form
-
Tcl
- Language type:
- Description:
Tcl (pronounced 'tickle') is a block-structured
interpreted scripting language intended
for portable
application development and extension.
The name originally stood for 'Tool
Command Language.'
The language and its interpreter were
designed to be easy to use for development
projects, and also easy to bind to other
programs and libraries written in C or C .
Tcl is frequently mentioned along with its
associated graphical toolkit, Tk. The
package, Tcl/Tk, is a complete system for
writing portable GUI applications.
Tcl and Tk are built to allow a programmer
to extend them with additional code written
in C/C , or to embed them into a larger
C/C application to serve as that application's
scripting language.
The syntax of Tcl is fairly simple, but
uses the command language paradigm
of verb-noun rather than the more
common expression-statement paradigm
used by scripting languages like Perl
and JavaScript. This approach makes
the language somewhat unforgiving in
terms of coding style. Tcl was originally
heavily oriented towards creating,
evaluating, and processing
strings. Tcl's syntax includes several
subtly distinguished quoting mechanisms.
Like many interpreters, Tcl has the ability
to create and then execute code on the fly.
Tcl offers a small set of very flexible
data types: numbers, strings, lists, and
associative arrays. In practice,
lists and associative arrays get used
for just about everything.
Tcl includes a conventional complement of
control structures: if-then-else, loop,
switch, and exception handling structures
are all provided (but with some quirks
driven by the command language verb-noun
structure.)
Tcl has extensive I/O capabilities, as
well as good features for invoking and
controlling local utility programs.
Tcl also provides network I/O support,
and mechanisms for asynchronous (event-driven)
scripting. Tcl does not support
a general concurrency or threading model.
Tk is a comprehensive GUI toolkit
offering the usual buttons, menus, labels,
and scrollbars. It also offers higher-level
facilties like lists, a vector-graphic
canvas, a sophisticated text display/editor,
color and clipboard management, and more.
Tcl was originally designed to be a common
scripting language to be embedded in
Unix graphical tools (the inventor of Tcl/Tk,
John Ousterhout, is also famous for his
contributions to the VLSI tool community).
Tcl evolved greatly in the early 1990s,
becoming a powerful scripting language
suitable for crafting whole applications.
In the mid-1990s, it was first ported to
a platform other than Unix, and has since
been ported to over a dozen operating
systems. Tk works under the X Window
System, MS-Windows, and the Macintosh.
Versions of Tcl prior to 8.0 were
strictly interpreted, and suffered from
a variety of performance problems related
to the interpretation process and the
interpreter's data storage mechanisms.
These problems were fixed in version 8.0,
and the language now employs an on-the-fly
bytecode compiler, and the data storage
management has been re-designed and
improved. Other new features in version
8.0 include reflection, separate namespaces,
and various system-dependent enhancements for
MS-Windows.
Information about Tcl/Tk is widely
available on the web, and there are also
a few good books about Tcl programming.
Extensions and add-ons for Tcl are common
and popular, especially extensions that
support object-oriented programming. A
very wide variety of such add-ons are
available free from Tcl download archives.
Various development tools are also
available, some free and some commercial.
Tcl/Tk 8.0 is available free from
Sun Microsystems for Unix, Windows,
Macintosh, and other platforms.
- Origin:
John Ousterhout et al, UC Berkeley, 1990.
- See Also:
- Remarks:
Tcl's syntax takes a little getting used to,
but it basically provides the same
functionality as a structured language
like Pascal. Unlike Pascal, Tcl is not
strongly typed. Numbers, strings, and
lists can be freely interconverted.
Tcl associative arrays are implemented as
hash tables, and provide the only heterogenous
aggregation facility in the language.
The real strengths of Tcl are its portability
and its extensibility. It is very easy
to embed a Tcl interpreter into an
application program (compared with embedding
Perl, for example, which is feasible but
difficult). It is also very easy to add
new commands to Tcl by linking in C or C
libraries. This friendliness has helped
drive Tcl's acceptance in some sectors
of the computing community.
In 1996 Tcl was also ported to the web
browser environment. The SafeTcl plug-in
allows any Netscape-compliant browser to
run specialized Tcl/Tk applications (called
Tclets) inside the browser window. As this
facilities is not yet offered directly
by the browser vendors, though, its
acceptance has been limited.
As of December 1997, most Tcl/Tk books
available were still stuck at version 7.
Be careful to check the version coverage of
any Tcl/Tk book before buying it.
- Links:
-
-
-
-
- Date:
- Sample code:
# Small Tcl sorting program, after Welch, 1997.
proc NameCompare {a, b} {
set $asurname = [lindex $a end]
set $bsurname = [lindex $b end]
set ret [string compare $asurname $bsurname]
if { $ret == 0 } {
$ret = [string compare $a $b]
}
return $ret
}
set namelist {}
set line {}
while { [gets stdin line] != 0 } {
lappend namelist $line
}
set namelist [lsort -command NameCompare $namelist]
set lineno 1
foreach line $namelist {
puts stdout "$lineno $line"
set lineno [expr $lineno 1]
}
Descriptions in this dictionary are ©1997-99 Neal Ziring. Some
examples copyright of their respective authors. Some
technologies and languages are trademarked. Permission to
copy descriptions is granted as long as authorship credit is preserved.
Comments on this dictionary, corrections and suggestions, are all welcome.
Please use email, the address is ziring@home.com
[Ziring MicroWeb Home]
[Dictionary Start]
[Sign Guestbook]
Dictionary and script maintained by Neal Ziring, last major modifications 3/18/98. Most recent
additions to dictionary and master list, 1/00.