Portability and reliability of Tcl
Posted by admin (Graham Ellis), 3 October 2002Posted by stan_ang to the "assistance" board - I have duplicated the post here so that it can be seen by folks who visit just to look at the Tcl pages
"do any of you guys know where i can get informations about the readability, writability, portability, reliability of tcl/tk? "
Posted by admin (Graham Ellis), 3 October 2002Tcl has been around for many years and is "as reliable as they get" - it words well, and any teething problems that it had were ironed out years ago. Don't be put off by the fact that it's free (distributed under an open source license) - it is of excellent quality and robustness.
When you add the Tk toolkit on top of Tcl, you're relying on the graphic facilities of the system that you're on - be it X windows for Unix or Linux based systems, or the windows libraries on a Microsoft based operating system. Again, they are very reliable but you should bear in mind that you'll get a slightly different look and feel as you move the code around. I've just move an application onto a Mac with OS X, and it came up straight away with the Mac look and feel.
The expect extendion (which you didn't mention) does some very clever things which, however, rely on the operating system in some very dependent way so there the portability is more limited. It works very well on Unix and Linux, it works on Windows if you have the right version.
Now ..."readabilty, writability". Great language for engineers, but if you're used to C, Perl or Vb you have to remember that Tcl is a command based language not an operator based language, so you need to "unlearn" a number of things.
Original poster - is this of any interest? Am I answering the right questions?
Others - do you have anything to add?
Posted by stan_ang (stan_ang), 6 October 2002graham,
with regards to the reliability, can u give comments about its type checking, exception handling, and aliasing? and on readability, can u tell me about the overall simplicity, orthogonality, context independent, and syntax considerations?
Posted by admin (Graham Ellis), 6 October 2002Err - what are you looking to do with Tcl, or are you looking for help writing an assignment answer? As regards to reliability, Tcl is a robust language - I've just got back from giving a course to a blue chip company who certainly wouldn't be using it if there were any serious reliability problems!
In Tcl, every varaible contains a a string, so type checking really isn't relevant unless I've missed soemthing in your question. Regular expressions make it possible (some would say easy) to check the format of a string within a variable, and Tcl won't let you use an uninitialised variable. A good practical mix - and it's a practical mix rather than orthogonallity that's the key in some of the command structures too - Tcl is a great language for engineers and practical applications, but you'll find the computer science theorists aren't always too happy with it - which I think is the side fo the argument that your question comes from!
Posted by stan_ang (stan_ang), 10 October 2002graham,
do you know anything regarding its binding times?
Posted by admin (Graham Ellis), 10 October 2002Stan, can you clarify what you mean by "binding" please - I tend to think of binding a variable name to a type of data storage, but that doesn't really apply to Tcl with everything being a string, and in any case I can't imagine what interest the time it took would be!
Posted by stan_ang (stan_ang), 14 October 2002i mean what attributes of a data object are bound during Translation? Execution? Language Design? and Language Implementation?
What are the built-in elementary data types available for Tcl/Tk?
What are the operations available for each of the data types?
please reply back thanks!
Posted by admin (Graham Ellis), 15 October 2002All data held in variables is held in strings in Tcl. It's an
interpretted language with dynamic variables, so that a new variable
object is created when you use a command such as set, with sufficient
memory being allocated to hold the string that you're setting to the
variable. Variable can also be extended (if you use a command such
as append or lappend), and are read back by the Tcl interpretter and
substituted when you preceed their name by a $. Variables can be
explicitly disposed of using the unset command.
Variables in procs are created in exactly the same way, but they're
deleted automatically when you leave the proc. If you want, you can
alter this behaviour using the static command to make a variable persist
from one invocation of a proc to the next, and you can also use the
global command to access a variable in the main interpretter's namespace
which will last as long as the main interpretter lasts.
Tcl lists are simply regular (string) variables to which a special syntax
has been applied, and arrays are a way of collecting together a number of
From your question, Stan, it looks as if you're planning to embed Tcl
into your own application, or looking at how that works. Perhaps you're
planning to stop and start multiple interpretters from your C? These
days, that's an unusual use of Tcl - most folk program in Tcl using
already embedded applications ranging from the tcl command itself through
wish and expect to Unigraphics software, Vignette, etc. John Ousterhout's
book "Tcl and the Tk toolkit", although now mature in years, has excellent
coverage of the various aspects of embedding, and I would suggest that
you get yourself a copy; from my viewpoint as a trainer, this isn't an
aspect that I get into too deeply or too often. There's a link to all
the Tcl books that I use at:
Posted by stan_ang (stan_ang), 19 October 2002graham,
im making a research about tcl/tk and i was given an outline. i need to know about the binding times of tcl/tk. i need to know what data objects are bound during Translation, Execution, Language Design, and Language Implementation. I also need to know if it has built-in elementary data types, subtypes and enumerated types. if they have, what are those? thanks!
Posted by stan_ang (stan_ang), 19 October 2002graham,
can u also give me some information about the different operations available for each of the data types? and kindly tell me its capabilities and limitation. thanks!
Posted by admin (Graham Ellis), 20 October 2002The more that I read your line of questioning, the less happy I feel that I'm understanding or answering what you're asking - much of this message repeats what I've already said earlier in the thread, but I don't really know what else to say.
In Tcl, all variable information is held in strings. Variables that contain strings are created as the program runs, within a wide variety of commands that you can find listed in any Tcl reference. It's made easy for you in that any command that uses a variable name without a $ is capable of setting a variable, whereas command syntaxes that include a $ in fromt of the variable name are leaving it to the Tcl interpretter itself to do the subsitution in of the variable contents (i.e. using the variable) before it ever gets to the command itself.
I think I'm saying that the binding is done at execution time, and (on reading your question again), this may be what you're asking rtaher than looking for the number of cpu cycles (or whatever) that it takes to create a variable - I don't have a clue as to what the answer would be to this latter question!
Tcl lists are strings held in a particular format, so may be regarded as subytpes using your terminology (so might arrays in a rather different way); once again, to find out what read and write operations are possible, check a good Tcl reference list to find the commands that are provided. Such documentation includes the capabilities and limitations of each command, and will be far longer that the posting limit that I'm restricted to here.
I understand an "enumerated type" to be a variable that can only contain one value from a permitted list (e.g. England, Scotland, Wales, Northern Ireland), and which is held internally as something else (e.g. 1, 2, 3, 4). There is no such enumerated type in Tcl.
Although by training I'm a "Computer Scientist" and very much aware of how things work within syntax analysis, compiler, interpretters, virtual machines, etc, there is very little call for compiler writers these days, so I spend my time training and advising on the practical application of languages to real life applications - the sort of thing you'll see on these boards. My background does help me to resolve what's going on in any scenario very quickly - I understand "under the hood" if you like - but I'm not one of the band of people who's actively involved in developing the next release of Tcl and I haven't made sufficeiently detailed a study of the internals of Tcl (nor Perl, PHP, etc ...) to answer questions at the level of the C language source code in which Tcl is written.
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho