1 / 10

TCL

TCL. Matthew Hamod Nicholas Will. Problem Domain. Designed to act as a powerful command language (scripting language) Could be implemented as a library package Not intended to be a standalone language Easy to create new features as part of the language. Historical Context.

omelissa
Download Presentation

TCL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TCL Matthew Hamod Nicholas Will

  2. Problem Domain • Designed to act as a powerful command language (scripting language) • Could be implemented as a library package • Not intended to be a standalone language • Easy to create new features as part of the language

  3. Historical Context • Developed by John Ousterhout • Stands for "Tool Command Language" • GUI applications becoming popular • Tools for creating GUI applications were complex • Some features of Tk may have influenced Java development

  4. Evolution of the Language • Started as a Unix only language • Eventually able to run on Windows and Mac • Started as a slow language • Originally, TCL code was completely interpreted • Brian Lewis created a bytecode compiler • Increased speeds by 5-10x

  5. Language Concepts • ; or newlines are command separators • } are command terminators • A word that starts with a $ is a variable • i.e. $variable • $variable(index) is an array • # is used for one line comments • Ending a line in a \ allows the comment to span multiple lines • A comment should only be placed where a command is expected

  6. Language Concepts • Strings • Don't need quotes • set greeting Hello! # this is perfectly valid • Quotes or braces are used for grouping • set example "this is one group" • set example {this is another} • String groups can span multiple lines and the newline will be included

  7. Examples of Use

  8. Examples of Use

  9. Comparison to Python • Both can be used as an extension or as a standalone language • TCL is weaker on data structures • TCL executes typical code much slower than Python • TCL lacks features needed for writing large programs (for instance, modular namespace) • Tk toolkit adds namespaces and increases speed

  10. Comparison to Perl • TCL passes arrays by name • Perl can pass arrays by reference or by value • Perl can analyze a script for errors in syntax without execution • TCL cannot, because it executes one line at a time • TCL is better at being used as a configuration file parser • TCL's command line library is well suited to being used from Perl

More Related