Subject: A description of a Tcl/Tk application. - DN [1]


Richard Pennington <rich@introl.com> - 07 Dec 1998 - comp.lang.tcl

 From time to time people in this group have expressed interest in the
 implimentation details of real applications written using Tcl/Tk. I am
 putting the finishing touches on a mid-sized application that uses
 Tcl/Tk
 primarily as the user interface implimentation language. For those that
 are interested, here is a brief description of the application along
 with
 some of our rationale for using Tcl/Tk and a breakdown of the C and
 Tcl/Tk
 code, in number of source lines, used in the application.

 Introl-CODE is an integrated development environment for
 microcontrollers
 that incorporates a project manager, editor, source level debugger and
 integrated on-line manual in HTML form. CODE can be used to create
 embedded
 systems based on the Motorola 68HC05, 68HC08, 68HC11, 68HC12, 68HC16,
 and
 68332 microcontrollers as well as the 6809 microprocessor. It can be
 used by
 people who make computer controlled devices such as cellular phones,
 automotive control systems, electronic scales, etc.

 CODE was written in a combination of the C programming language and the
 Tcl/Tk scripting language. C was used for processor intensive activities
 like the processor specific C compilers, assemblers, and simulators,
 while
 Tcl/Tk was used for the user interface.

 C was chosen as the primary development language primarily for
 portability:
 many of the compilers, asemblers, linkers, etc. have existed in
 approximately
 their current form for over ten years and have been distributed on
 several host
 platforms, including MS-DOS, VMS, Windows, HP/UX, SunOS, Ultrix, AIX and
 MacOS as command line applications. We have had good experience with C's
 portability across several platforms.

 Tcl/Tk was chosen as the user interface language after examination of
 several cross platform graphical user interface development packages.
 Most
 of the other alternatives required recompilation after the smallest user
 interface change and took quite a while to build and experiment with
 interface ideas. Tcl/Tk, on the other hand, because it is interpreted
 allowed
 us to rapidly prototype and modify user interface ideas, without giving
 up
 performance.

 The fact that Tcl/Tk was open source convinced us: we were not dependent
 on the whims of the development package manufacturer if we wanted to
 port
 CODE to different host platforms or use different development tools.

 The program mix in CODE is approximately:

     C source including header files: 565000 lines.
     Tcl/Tk source: 32000 lines.

 The C source can be further broken down:

     Command line programs: 195000 lines.
       (The C compilers, assemblers, linkers, conversion utilities.)
     Tcl/Tk interpreter: 294000 lines.
       (Minor changes to compile with our development tools.)
     Extensions to Tcl/Tk: 76000 lines.
       (Microntroller debugger support, processor simulators, HTML
        renderer, C syntax coloring.)

 The Tcl/Tk source can be further broken down:

     Hand coded: 20000 lines.
       (The primary user interface and most of the project manager.)
     Build with GUI generator (SpecTcl): 12000 lines.
       (Additional user interface dialog boxes.)

 In addition to using Tcl/Tk to generate the user interface, we have also
 been able to give users of our product access to Tcl/Tk for their own
 scripting. Program builds can have arbitrary scripts run during the
 course of building. The debugger allows Tcl/Tk scripts to be used to
 control the target processor and display data structures and I/O
 devices.
 The processor simulators can have scripts attached that handle various
 breakpoint conditions allowing the simulation of I/O and timers as well
 as to supply test data to the program under simulation.

 We have been very happy using Tcl/Tk as our deveopment environment for
 this
 project. The code we produced is very portable between Windows and Unix,
 we have been able rapidly prototype and try new ideas, and we have
 gained
 a powerful scripting language in our application.

 -Rich
 --
 Richard Pennington        Introl Corporation, Milwaukee, WI USA
 Email: rich@introl.com        Phone: +1 414-273-6100    Fax: +1 414-273-6106
                 US and Canada: 1 800-327-7171
 Cross development tools for the 68HC05, 68HC08, 6809, 68HC11, 68HC12,
 68HC16,
 and 68XXX:            http://www.introl.com    ftp://ftp.introl.com

Last modified
1999-09-27

(195.108.246.50)

Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated