Introduction - 1

History - 2

Overview - 3

Advanced features - 4

Work in progress - 5

One possibility - 6

Conclusion - 7



Appendix 1 - blowfish

Appendix 2 - tkspline

1 - Introduction

Scripting can only get you so far. Often the last 5-10% of an application needs to be compiled, for a number of reasons, including

  • performance
  • to hide proprietary features (such as licensing)
  • custom features that can't be implemented in Tcl
  • the use of compiled extensions

Fortunately, it is relatively easy to add C extensions to Tcl, either by building custom interpreters or dynamically loadable extensions. But it is still a complex issue - not only does one have to deal with tools such as autoconf, make, etc. - but it also means having a development environment configured with Tcl/Tk header files and "stub libraries". The conceptual difference between "writing a bit of C code" and having an extension which is actually callable from a Tcl script can be daunting. Worse, the Tcl build environment is somewhat foreign to those building on a Windows platform (TEA is not everyone’s cup of tea). Yes, "real programmers" will point out that this is what it takes to do "true" programming. But for many who are used to the productivity of Tcl it can easily become a frustrating and time-wasting exercise.

This paper describes Critcl - which stands for "Compiled Runtime In Tcl" - a tool designed to address these issues. Critcl allows C code to be embedded in Tcl scripts, (transparently) compiled and called like any Tcl procedure.

Critcl also takes care of many of the details of building compiled extensions, hiding issues such as including Tcl headers, stubs support and creating Tcl commands for C functions - even setting up fully TIP 55 compliant packages in a directory, with a cross-platform pkgIndex.tcl ready to go.

see also

Critcl Home Page

Tclkit Home Page

Starkit Home Page

Wikit Home Page

Tclers' Wiki

Steve's Website

Jean-Claude's Website

Paper by S. Landers & J.C. Wippler, as presented at Tcl/Tk 2002 conference - see also original PDF.

Papers & Presentations