Function theory on the other hand deals with how operations can be combined together. Function Theory has some important results which will eventually do for computer programs what relation theory did for the computer information. It gives us a set of rules which provide a rigourous framework for computer programs that will provide the basis for Artificial Intelligence in about 10 years.
Tcl was invented around 1988 as a distillation of the fundamentals of programming language which had been learnt over the previous decade. Tcl represents perhaps the most concise distillation of what a programming language needs to be, and as such is never likely to be improved on. It is so simple its rules can be written on the back of a postcard with no fineprint.
Tcl was quickly picked up in tertiary and some scientific establishments by non-programmer technicians who wanted a good language with liitle learning curve. Acceptance beyond this circle has been slow, partly because its initial platform was unix which was mainly used in the same educational and scientific world. So the future of Tcl has been somewhat tied to the future of unix which has been slow and steady.
The development of the net has pushed unix into the forefront of operating systems. Also Tcl has been generalised to Windows and Mac platforms with no major crinkles, and with only a few limitations naturally dictated by the new platforms. In the race to be part of the net the language perl beat Tcl to the post and became the default cgi script language used by servers. This was mainly because perl was a very limited language that could be used safely in the net without providing doors for hackers. Tcl was then issued in a form in which its more powerful features could be controlled, safe Tcl so that hackers could not use its powerful features to create havoc. However Tcl is still trying to recover ground in its position on the net. The Tcl plugin while readily available, is not yet a bundled feature provided with major web servers, as perl is.
However the position of Tcl in the computer community is slowly consolidating as more home users discover it and its potential to solve seemingly insurmoutable tasks with ease as many of the projects in this course will demonstrate.
Tcl comes with an extension which gives ready access to windows programming features, this is the Tk part of Tcl/Tk. Tk has ensured the continued survival of Tcl by allowing graphical interfaces for any application program to be written easily.
The definition of Tcl is very simple, but is amenable to being extended in any direction your imagination choses. These extensions are numerous and readily available to increase the power of Tcl to do specialist tasks, but they are not included in the base configuration of Tcl. Components are only incorporated into the base edition of Tcl when a major general need is seen to be met. This means that Tcl/Tk remains a managably small environment to learn and use, though it is not all that small as a glance at any book on Tcl/Tk will indicate.
Tcl is an interpreted language which is ideal for learning applications which require the following properties:
- Simple and easy to learn
- Easy to remember
- Easy to write using simple tools
- Concise
- Easy to run and test programs
Compiled languages such as C++ are used for other reasons such as:
- optimal efficiency of code execution
- optimal efficiency of data transfers
But these benefits are only sought when a program is going to be used massively over a long period of time. Programming exercises are generally not expected to be used beyond their test phase. Compiled languages tend to have disadvantages for the education sector:
- Syntax oriented which is not very natural, and not easy to learn or remember
- Verbose and often complex
- Use concepts such as structure and pointers which are not intuitively easy for a beginner to understand
- Slow turnaround to compile, and test or run.
- The programming environment has to be learnt and understood, managed and maintained.
Historically interpreted languages such as Basic have been used in education to sidestep these problems.
The Tcl Advocacy page gives a brief outline of the features which Tcl has in common with some other scripting languages. We are of course interested more in the differences and the advocacy page assumes readers understand the issues behind such phrases as ''great regular expression''. I will explain the significance of some of these:
- Great regular expressions: - regular expressions are a building block of computer language which solve many of the ''tricky'' programming problems. Chances are if you ask a programmer to process a file in an interesting way and the programmer says ''oh, thats too hard to do'' he is not using a language with great regular expressions.
- Easily extensible: - this means that you can extend the power of the language by adding your own extensions which become a seamless part of the language. One might think that the language would proliferate with everybodys' different extensions and become unmanagable, but in fact this facility has the opposite effect. It enables the base language to remain small and compact. If you want to do something special you incorporate the extension you want from a library of extensions that are maintained by people all over the world. You generally do not need to write your own extensions.
- Embeddable:- this means that Tcl can be used from inside applications written in other languages. This is important if you are developing a large complex system in a compiler language. Parts of the system can be prototyped in Tcl and embedded in the system. The Tcl may then be rewritten later or if it is effecient enough at its job, left as is. A large system can be cheaply and easily prototyped in Tcl and user tested before going to the expense of implementing it in C++ for instance.
- Cross platform:- Visual Basic is a proprietary product which is tied to a specific operating system by its commercial links. This means that it will always try to differentiate itself in order to gain market leverage. This process creates system diversity, rather than unity, even though such proprietary products are usually well-featured. Cross platform languages on the other hand are available on a range of platforms and behave the same on all platforms. At best they preserve the "look and feel" of their host platform and Tcl does just that. In other words, Tck/Tk look and behave on a Mac the way a Mac user would expect and behave and look on a Windows machine the way a Windows user would expect.
One area where Tcl is of particular relevence is in the area of Infrastructure between the Ministry of Education and Schools. As an example, there is now a call out to actually assess whether the Ministry of Education is meeting its defined aims of raising educational levels. This will require an assessment system. What that system should be is still under debate. But developing a system involves some major hurdles.
- Integrating MinEd systems with the plethora of school systems, so that assessment programs developed via the MinED can be used unifromly by all schools, without the need for local development or maintenance. Tcl's cross platform feature accounts for this.
-
Developing a low cost prototype which can be tested by a school cohort. Tcl provides capability and includes good GUI features. This is its unique position in the field.
-
Easily managed and staged conversion of the prototype to a full system. Tcl's embeddable feature makes this possible, although it is quite possible that the prototype may be able to be used as the final system.
In this course I take the opportunity to use programs written in Tcl in order to teach students how to use various applications, whether it is simple text editing, using a compuer for drawing and so on.
There are a number of reasons for doing this:
- The same program can be used on different platforms even within the same classroom where students may have their own personal laptops with different operating systems.
- The programs are non-proprietary. They are written by ordinanry guys, often students, most of whom you can email on the net. This demystifies that ''secretive'' process of writing application programs which is fostered by proprietary companies to preserve their investment. Students can see that programs can be easily written by anyone and that proprietary product is not "better".
- The programs can be scaled to the purposes of the lessons to be learned. As an example a teacher can try to teach students how to use a paint program. First there is the learning curve of the teacher learning about the program so that he can answer students curious questions. Most painting programs are very fully featured and it takes a long time, maybe a week, to learn what all the features are let alone how to use them properly. In the class the student is confronted by a complex program that simply "looks complicated". While some students will sink under the apparent complexity, others will want to learn it all at once and confound the teacher. The answer to this problem is to have cut-down versions of the program that is being taught which only have the features that are important to the lesson. This can be done by using programs written in Tcl. Programs can be tailored to each class session and students will neither be overwhelmed or be able to exceed the bounds of the lesson.
- The program code can be inspected by the curious to see how it works, and in many cases to see how simple it is. Students may not have any use for the code at the time that they are learning to use a particular program like a text editor, but will recall the examples later when they do projects to write similar programs and be able to go back and reuse some code.
- Students can study the program code to find out how to design extensions to an existing product to build on it.