Version 13 of Salvatore Sanfilippo

Updated 2003-10-31 21:45:59

Some kind of hacker (davidw was too kind with me in the last version of this page ;).

I like TCL, while there are a number of changes I propose (look forward on this page).

Why I like TCL?

For the following reasons: TCL is the glue able to combine data and code in a direct and expressive way, without tons of special rules, but with few basic ideas that works accross the whole language, in an orthogonal way. Also TCL doesn't force you to take the language as it is, you can extend TCL in itself, so eventually you start programming bottom-up like in lisp-like languages. In TCL like in Lisp it's possible to adapt the language to fit well the application you are writing, then to write the application in this new language. So after all I like TCL for the same reasons I like Scheme, but I tend to use they for very different tasks: when I need the ability to work a lot with strings, regexps, libarires, mix with C code, TCL is my way to go.

For what I use TCL?:

  • One-page scripts that do a lot of works with sockets, files, regexps, and so
  • Vertical programs with GUI that I use to sell to my customers
  • My own experiment with new interesting ways to use the server/client model
  • I'm starting to use it for web programming
  • Random hacking where all-is-a-string-and-i-like-to-eval-it comes handly

And of course I use it a lot when I think to major ideas in programming languages. TCL, like Lisp and SmallTalk, have something of special in the design.

I know TCL thanks to davidw, he used to show me the main ideas, and after some time I got in love of the language (at the point to write a TCL-like programming language that is nowaday just a dead piece of code into my HD). Since then I used many other languages with the same target, such Python, but I like much more the flexibility of TCL.

Other languages I like are: C, Scheme, SmallTalk, FORTH.

How to make TCL better in my opinion

In short:

  • Don't make math an exception in the language, expr should be just an optional,

but the core language should support math using commands like +, *, / and so on, with lisp-like semanthics so that

 [/ 1 2] => 1/2

Also native support for bignums seems to fit perferctly in TCL.

  • No implicit expr inside if, while, and so on.
  • Minimal TCL core, just what is needed to define the language. All the rest are libraries.
  • Support for references, see Tcl references in Tcl
  • A standard support for packet oriented protocols like UDP
  • Maybe some kind of macro system to try new ideas for the language in short time. Roy Terry, 31Oct2003: Tmac can do that in pure tcl code. I will be posting an update soon that does include examples of new language features such as enhanced switch and foreach command. Tmac - a Tcl macro processor package
  • No special-case types like arrays, but what I read about Tcl 9 is great! (dictionaries).

Random Stuff

The regmap function may be more secure (against malicious user input) and clean than the usual regsub+subst way, at least some time. Please tell me if something like this is already in some well known library.


Category Person