Commands Prefix Notation Variadic: Web Applications

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Tcl (Tool Command Language) is a very powerful but easy to learn dynamic programming language,

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.

Tcl's features include

 All operations are commands, including language structures. They are written in prefix notation.

 Commands are commonly variadic.

 Everything can be dynamically redefined and overridden.

 All data types can be manipulated as strings, including source code.

 Event-driven interface to sockets and files. Time-based and user-defined events are also possible.

 Variable visibility restricted to lexical (static) scope by default, but uplevel and upvar allowing procs to

interact with the enclosing functions' scopes.

 All commands defined by Tcl itself generate error messages on incorrect usage.

 Extensibility, via C, C++, Java, and Tcl.

 Interpreted language using bytecode

 Full Unicode (3.1) support, first released 1999.

 Cross-platform: Windows API; Unix, Linux, Macintosh, etc.

 Close integration with windowing (GUI) interface Tk.

 Multiple distribution mechanisms exist:

 Full development version (e.g., ActiveState Tcl)

 tclkit (kind of single-file runtime, only about 1 megabyte in size)

 starpack (single-file executable of a script/program, derived from the tclkit technology)

 freewrapTCLSH turns TCL scripts into single-file binary executable programs.

 BSD licenses, freely distributable source.

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

graphical window as well as providing Tk.

Tk has the following characteristics:

 Platform-independent: Like Tcl, Tk is interpreted. It has been ported to multiple platforms and can easily

run on all of them without modification.

 Customizable: Almost all of the features of a widget in Tk are customizable through options during the

creation of the widget or later on through the configure command.


 Configurable: Many of the options can be stored in an option database, making it very easy to parameterize

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.

You might also like