Category:Tcl: Difference between revisions
(made license link to somewhere useful) |
m (introduce encyclopedic links) |
||
Line 26: | Line 26: | ||
==Language Value Model== |
==Language Value Model== |
||
Tcl's value model operates on two levels. |
Tcl's value model operates on two levels. |
||
* Classically, it is defined purely on unmodifiable strings over a language of unencoded UNICODE characters. |
* Classically, it is defined purely on unmodifiable strings over a language of unencoded [[UNICODE]] characters. |
||
* Practically, values are polymorphic and hold a cache of the last type-interpretation that they were used with, together with an optional UTF-8 string representation. They are reference counted and are not modifiable (unless the code in question holds the only reference, which is a significant efficiency gain; if the value is shared, it is shallow-copied upon modification). Although only reference counted, they are effectively garbage-collected since circular data structures cannot be constructed (performing such construction requires holding two references to the same object, which forces a copy to be taken and breaks the reference loop). The net effect of this is just like the UNICODE string classical model, except much faster. |
* Practically, values are polymorphic and hold a cache of the last type-interpretation that they were used with, together with an optional [[UTF-8]] string representation. They are reference counted and are not modifiable (unless the code in question holds the only reference, which is a significant efficiency gain; if the value is shared, it is shallow-copied upon modification). Although only reference counted, they are effectively garbage-collected since circular data structures cannot be constructed (performing such construction requires holding two references to the same object, which forces a copy to be taken and breaks the reference loop). The net effect of this is just like the UNICODE string classical model, except much faster. |
||
The language supports the following basic types, together with many defined by extension packages: |
The language supports the following basic types, together with many defined by extension packages: |
||
* Unicode strings |
* Unicode strings |
Revision as of 10:10, 6 July 2009
This programming language may be used to instruct a computer to perform a task.
Garbage collected: | Yes |
---|---|
Parameter passing methods: | By value |
Type safety: | Safe |
Type strength: | Weak |
Type compatibility: | Duck |
Type expression: | Implicit |
Type checking: | Dynamic |
See Also: |
|
Tcl (short for Tool Command Language) is a scripting language with very simple syntax, dynamic typing, automatic storage allocation and garbage collection and native Unicode support. Tcl is often combined with the Tk library. As a result, it is often referred to as Tcl/Tk.
Tcl is known to be supported under a variety of popular operating systems, including UNIX, Linux, BSD, Windows, WinCE, PocketPC, Mac OS X and BeOS. Tcl is distributed under the BSD License.
The Tcl language has been implemented in multiple lower-level languages. The most common one is libtcl, written in C, which is the engine used to power tclsh and wish, but others exist. Notably, these include Jacl and Eagle, which implement Tcl in Java and C# respectively.
Its creator, John Ousterhout, wrote about it:
- “I got the idea for Tcl while on sabbatical leave at DEC's Western Research Laboratory in the fall of 1987. I started actually implementing it when I got back to Berkeley in the spring of 1988; by summer of that year it was in use in some internal applications of ours, but there was no Tk. The first external releases of Tcl were in 1989, I believe. I started implementing Tk in 1989, and the first release of Tk was in 1991.”
Language Value Model
Tcl's value model operates on two levels.
- Classically, it is defined purely on unmodifiable strings over a language of unencoded UNICODE characters.
- Practically, values are polymorphic and hold a cache of the last type-interpretation that they were used with, together with an optional UTF-8 string representation. They are reference counted and are not modifiable (unless the code in question holds the only reference, which is a significant efficiency gain; if the value is shared, it is shallow-copied upon modification). Although only reference counted, they are effectively garbage-collected since circular data structures cannot be constructed (performing such construction requires holding two references to the same object, which forces a copy to be taken and breaks the reference loop). The net effect of this is just like the UNICODE string classical model, except much faster.
The language supports the following basic types, together with many defined by extension packages:
- Unicode strings
- Binary strings
- Integers of unbounded width
- Double-precision IEEE floats
- Booleans
- Lists of values
- Dictionaries mapping values to values
- Assorted "cache" types used to boost performance:
- Command handles (several types)
- Variable handles (several types)
- Compiled regular expressions
- Compiled scripts (several types)
- etc.
Note that all variables can hold values of any type; the language does not impose type constraints on variables at all.
External Links
Subcategories
This category has the following 4 subcategories, out of 4 total.
@
- Tcl Implementations (11 P)
- Tcl User (40 P)
T
Pages in category "Tcl"
The following 200 pages are in this category, out of 983 total.
(previous page) (next page)D
- Date manipulation
- Day of the week
- Deal cards for FreeCell
- Death Star
- Decimal floating point number to binary
- Decision tables
- Deconvolution/1D
- Deconvolution/2D+
- Deepcopy
- Define a primitive data type
- Delegates
- Delete a file
- Deming's funnel
- Department numbers
- Detect division by zero
- Determinant and permanent
- Determine if a string has all the same characters
- Determine if a string has all unique characters
- Determine if a string is collapsible
- Determine if a string is numeric
- Determine if a string is squeezable
- Determine if only one instance is running
- Dice game probabilities
- Digital root
- Digital root/Multiplicative digital root
- Dijkstra's algorithm
- Dinesman's multiple-dwelling problem
- Dining philosophers
- Disarium numbers
- Discordian date
- Display a linear combination
- Distributed programming
- DNS query
- Documentation
- Dot product
- Doubly-linked list/Definition
- Doubly-linked list/Element definition
- Doubly-linked list/Element insertion
- Doubly-linked list/Traversal
- Dragon curve
- Draw a clock
- Draw a cuboid
- Draw a pixel
- Draw a rotating cube
- Draw a sphere
- Dutch national flag problem
- Dynamic variable names
E
- Echo server
- Element-wise operations
- Elementary cellular automaton
- Elementary cellular automaton/Infinite length
- Elementary cellular automaton/Random number generator
- Elliptic curve arithmetic
- Emirp primes
- Empty directory
- Empty program
- Empty string
- Enforced immutability
- Entropy
- Entropy/Narcissist
- Enumerations
- Environment variables
- Equilibrium index
- Ethiopian multiplication
- Euler method
- Euler's identity
- Euler's sum of powers conjecture
- Evaluate binomial coefficients
- Even or odd
- Events
- Evolutionary algorithm
- Exceptions
- Exceptions/Catch an exception thrown in a nested call
- Executable library
- Execute a Markov algorithm
- Execute a system command
- Execute Brain****
- Execute HQ9+
- Execute SNUSP
- Exponentiation operator
- Exponentiation order
- Extend your language
- Extensible prime generator
- Extract file extension
- Extreme floating point values
F
- Factorial
- Factors of a Mersenne number
- Factors of an integer
- Farey sequence
- Fast Fourier transform
- FASTA format
- Fermat numbers
- Fibonacci n-step number sequences
- Fibonacci sequence
- Fibonacci word
- Fibonacci word/fractal
- File extension is in extensions list
- File input/output
- File modification time
- File size
- File size distribution
- Filter
- Find common directory path
- Find duplicate files
- Find first and last set bit of a long integer
- Find largest left truncatable prime in a given base
- Find limit of recursion
- Find palindromic numbers in both binary and ternary bases
- Find the last Sunday of each month
- Find the missing permutation
- Find URI in text
- Finite state machine
- First class environments
- First-class functions
- First-class functions/Use numbers analogously
- Five weekends
- Fixed length records
- FizzBuzz
- Flatten a list
- Flipping bits game
- Flow-control structures
- Floyd's triangle
- Floyd-Warshall algorithm
- Forest fire
- Fork
- Formal power series
- Formatted numeric output
- Forward difference
- Four bit adder
- Fractal tree
- Fractran
- FTP
- Function composition
- Function definition
- Function frequency
- Fusc sequence
G
- Galton box animation
- Gamma function
- Gapful numbers
- Gaussian elimination
- General FizzBuzz
- Generalised floating point addition
- Generate Chess960 starting position
- Generate lower case ASCII alphabet
- Generator/Exponential
- Generic swap
- Get system command output
- Globally replace text in several files
- Go Fish
- Gray code
- Grayscale image
- Greatest common divisor
- Greatest element of a list
- Greatest subsequential sum
- Greedy algorithm for Egyptian fractions
- Greyscale bars/Display
- Guess the number
- Guess the number/With feedback
- Guess the number/With feedback (player)
- GUI component interaction
- GUI enabling/disabling of controls
- GUI/Maximum window dimensions
H
- Hailstone sequence
- Hamming numbers
- Handle a signal
- Happy numbers
- Harmonic series
- Harshad or Niven series
- Hash from two arrays
- Hash join
- Haversine formula
- Hello world/Graphical
- Hello world/Line printer
- Hello world/Newbie
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Hello world/Web server
- Here document
- Heronian triangles
- Hickerson series of almost integers
- Higher-order functions
- History variables
- Hofstadter Figure-Figure sequences
- Hofstadter Q sequence
- Hofstadter-Conway $10,000 sequence
- Holidays related to Easter
- Honeycombs
- Horizontal sundial calculations
- Horner's rule for polynomial evaluation
- Host introspection
- Hostname
- Hough transform
- HTTP
- HTTPS
- HTTPS/Authenticated
- HTTPS/Client-authenticated
- Huffman coding
- Humble numbers
- Garbage collection/Yes
- Parameter passing/By value
- Typing/Safe
- Typing/Weak
- Typing/Compatibility/Duck
- Typing/Expression/Implicit
- Typing/Checking/Dynamic
- Programming Languages
- Programming paradigm/Concurrent
- Programming paradigm/Dynamic
- Programming paradigm/Event-driven
- Programming paradigm/Imperative
- Programming paradigm/Object-oriented
- Programming paradigm/Reflective
- Codepad languages