Professional Documents
Culture Documents
Commands Prefix Notation Variadic: Web Applications
Commands Prefix Notation Variadic: Web Applications
Commands Prefix Notation Variadic: Web Applications
suitable for a very wide range of uses, including web and desktop applications, networking,
administration, testing and many more. Open source and business-friendly, Tcl is a mature yet
evolving language that is truly cross platform, easily deployed and highly extensible.
Tk is a graphical user interface toolkit that takes developing desktop applications to a higher level than
conventional approaches. Tk is the standard GUI not only for Tcl, but for many other dynamic
languages, and can produce rich, native applications that run unchanged across Windows, Mac OS X,
Linux and more.
All operations are commands, including language structures. They are written in prefix notation.
Variable visibility restricted to lexical (static) scope by default, but uplevel and upvar allowing procs to
All commands defined by Tcl itself generate error messages on incorrect usage.
Interpreted language using bytecode
The Tcl language has always supported extension packages, which provide additional functionality, such as a GUI,
terminal-based application automation, database access, etc.
Web Applications
Tcl, being a dynamic, string oriented language, is a great match for web applications. Rather than
taking a one-size-fits-all approach, a number of different solutions have evolved:
For massively scalable database backed websites, the Tcl powered AOLserver (which runs some of
AOL's largest sites) is ideal, often paired with the OpenACS community system.
TclHttpd is a high performance, highly programmable web server that is designed to run either
standalone or to be embedded in other applications — written in pure Tcl. Skeptical? It's running
this site right now.
Tcl can also be used as a conventional web programming language; a number of CGI libraries are
available, including ncgi which is part of Tcllib. Another option is Rivet, which runs as an Apache
module.
TK :
Tk is an open source, cross-platform widget toolkit that provides a library of basic elements for building a graphical
user interface (GUI).
Tk provides a number of widgets commonly needed to develop desktop applications such as button, menu, canvas,
text, frame, label etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Windows. Since Tcl/Tk
8, it offers "native look and feel" (for instance, menus and buttons are displayed in the manner of "native" software for
any given platform). Also, there are several extensions to provide external drag-and-drop, non-rectangular windows,
and native widgets. A new theming engine called Tk Tile is included in the 8.5 release. Like Tcl, Tk
supports Unicode within the Basic Multilingual Plane but it has not yet been extended to handle 32-bit Unicode.
On *nix systems, Tk 8.4 and below still use bitmap fonts, but Tk 8.5 uses outline fonts
(notably TrueType and OpenType fonts).
Architecture
Tk is a platform-independent GUI framework developed for Tcl. From a Tcl shell (tclsh), Tk may be invoked using this
command: package require Tk. The program wish (WIndowing SHell) provides a way to bring up a tclsh shell in a
Platform-independent: Like Tcl, Tk is interpreted. It has been ported to multiple platforms and can easily
Customizable: Almost all of the features of a widget in Tk are customizable through options during the
the look of an application (such as the color scheme). This also means that storing the application-specific
options is only a matter of saving the option add commands and executing them on loading the application.
There are several ways to use Tk from Perl: the Tcl::Tk and Tkx Perl modules, both of which use Tcl as a bridge to
access Tk, and Perl/Tk, which provides native Perl access to Tk structures. The Python and Ruby bindings use Tcl as
a bridge to Tk.