Assignment - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Assignment

Description:

Source kept free. Many improvements. Scriptics TCL Core Team. Syntax ... No static typing. variable can contain integers, floats, strings, lists or whatever ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 14
Provided by: petem9
Category:

less

Transcript and Presenter's Notes

Title: Assignment


1
TCL
  • Assignment 11
  • Pete Moore
  • COSC 4153
  • Spring 2008

2
Overview
  • History
  • Syntax
  • Features
  • Example Code
  • Language Use
  • Advantages and Disadvantages
  • Likes and Dislikes

3
History
  • John Ousterhout
  • Integrated Circuit Design at Berkely
  • Poor Command Languages for tools
  • Embeddable command language
  • Extensions could control the application
  • Tool Command Language
  • Tk GUI's becoming popular and expensive
  • 1989 he gave a talk about it word spread
  • Sun
  • Source kept free
  • Many improvements
  • Scriptics TCL Core Team

4
Syntax and Semantics
  • Command argument argument ...
  • Command command argument
  • Symbols
  • -- variable substitution
  • argv0 could be replaced by /usr/bin/script.tcl
  • -- subcommand substitution
  • pwd might be replaced by /home/moorep
  • "" -- word grouping with substitutions
  • "you are user" is one word user is replaced
  • word grouping without substitutions
  • you are user is one word, but user is not
    replaced

5
more Syntax and Semantics
  • More symbols
  • \ -- backslash substitution/escape
  • by default, statement ends with the line
  • -- comment
  • -- statement separator
  • Command1 arg command2 arg
  • -- namespace path separator
  • (e.g. foobar)?
  • No static typing
  • variable can contain integers, floats, strings,
    lists or whatever
  • Assignment is made with set
  • set someVar value

6
Features
  • C
  • stdin, stdout, stderr
  • argv
  • for loop, while
  • if, switch
  • fopen, fputs, fgets, fclose, ftell (no f)?
  • sprintf is format
  • expr syntax (infix operators, functions,
    parens..)?
  • Awk/Snobol
  • associative arrays

7
Example Source Code
  • Associative array stuff
  • set capital(India) Delhi
  • set capital(France) Paris
  • set capital(Italy) Rome
  • set capital(Germany) Berlin
  • set capital(Poland) Warsaw
  • set capital(Russia) Moscow
  • puts capital(Italy)?
  • lsort array names capital

8
More Source Code
  • Proc

proc sum arg1 arg2 set x expr arg1
arg2 return x puts " The sum of 2 3
is sum 2 3\n\n
  • C\TuxRacer Code.tcl


9
Language Use
  • TuxRacer
  • Web Applications
  • Huge database backed sites like, AOLserver
  • Can also be used as a conventional web language
  • Desktop GUI Applications
  • Dynamic approach fit's GUI's better than
    low-level C and C toolkits
  • Testing and Automation
  • Embedded Development
  • Cisco
  • Dominates EDA and CAD

10
Advantages and Disadvantages
  • Disadvantages
  • You might not know it yet
  • Advantages
  • Can embed and build on anything on it
  • Comes with Tk

11
Likes and Dislikes
  • Dislikes
  • Wide use makes it daunting at first
  • Wide amount of commands is also scary
  • Likes
  • Syntax looks very simple
  • Typing looks very friendly
  • Note
  • How I encountered TCL

12
Conclusion
  • History made John Ousterhout
  • Embeddable can be made to do many things
  • Tk good for GUI's
  • Tuxracer apparently works for 3d games

13
Bibliography
  • http//www.tcl.tk/
  • http//www.tcl.tk/about/history.html
  • http//wiki.tcl.tk/
  • http//en.wikipedia.org/wiki/Tcl
Write a Comment
User Comments (0)
About PowerShow.com