Version 5 of Coming to Tcl/Tk from an IDE environment

Updated 2002-06-30 07:20:38

Purpose: to provide a forum where developers used to an IDE development environment can share tools which provide them an environment suitable for development.

I hope established Tcl developers, as well as people learning to program Tcl the first time, update/add to this page information they find useful.


There have been times when users (particularly from the Windows development arena) come to the Tcl community perplexed as to how to get started.

Some of the issues they face are:

  • How do I write Tcl programs?
  • How do I run Tcl programs?
  • How do I debug Tcl programs?
  • Where do I find useful Tcl or Tk widgets?
  • How do I compile Tcl, Tk, or some extension?

Tcl (and Tk) in their purest form (that is to say, either the source or perhaps executable form from the http://tcl.sf.net/ project) comes with minimal development aids. It is expected that the user will either already have a suitable set of tools for performing text editing, etc. or that you are willing and able to download various tools.

The standard development cycle for Tcl programs (that one plans on keeping) might be summarized:

  1. Start up a text editor.
  2. Write your Tcl code.
  3. Save the Tcl code to a file.
  4. Start up a Tcl interpreter.
   start loop
  1. Using the Tcl 'source' command, source in the Tcl code.
  2. Invoke Tcl procedure, if your Tcl code file doesn't already do that.
  3. If the program works as expected, you are done. Exit loop
  4. Otherwise, edit the Tcl code. Perhaps add puts statements, or some other
        type of debugging code.
   end loop







CL thinks it's important to say that it's not just that Tcl/Tk is defective in failing to integrate an IDE in the way someone coming from Delphi or Visual C++ might expect. Tcl/Tk programming is different from programming in those other languages, and has less need for an IDE. At some point in your Tcl programming career, try working with the language "on its own terms". Many of the most experienced Tcl developers find that a more satisfying approach than use of an IDE.

These comments are specific to Tcl in its technical development as of 2002 (say).


However, it is only fair to ask in response if one could be more clear about what you mean when you say try working with the language "on its own terms"'.

What I have seen is that people who have years of experience typing in printf statements in C, etc. do not always appreciate the value of an fully interactive debugging environment with the ability to modify code dynamically during the execution of the program and then continuing, for example. For that matter, people used to using vi or some other vanilla text editor may not appreciate the value of syntax coloring, statement completion, etc.


Tcl has a one great future that in standard pure tcl-console is very cumbersome to use and for ready tcl-scripts is not nessesary. It are introspection-posibbility of tcl. In tcl it is possible to redefine the procedure from the console and show it again on the console with 'info body procname'. In the fact the way of programing known from compiled languages that is:

1. edit your script in editor 1. run it 1. show if it crash or work good

can be with tcl easier. In tcl is no need to reload all scripts and build runtime program-context after every program error but normal tcl-programer do it.

The people who know 'Smalltalk' know how powerfull environments can one build by using introspection posibbility of program-language. The most Tcl-IDE copy the IDEs-functionality from compiled languages as C,C++,Java. They bring some benefits in editing source and manage the programm files.

XotclIDE is the new IDE that try to work as Smalltalk envirorments. XotclIDE-user do not manage some tcl-scripts but view the tcl-interpreter-state and modifity it iterative. All this by using tcl-introspection. At the end of progrming-session the state of interpreter can be save as tcl-packages. The interpreter-state can be optionaly save on the flow in version-control database.