OOP with Tcl


Many a times you get to hear that Tcl (Tool Command Language) doesn’t provide ample support for the object-oriented programming. Although Tcl doesn’t force anyone to write his/her object-oriented code, it certainly provides the flexibility if anyone wishes to, in many different ways.

Tcl features multiple object systems

Tcl was built in a manner that it could be easily extended. All sorts of distinct object-oriented extensions have thus been created and used over the years. Going back to the year 1993 and up till now, a good number of papers have also appeared on this subject year after year. This shouldn’t come as a surprise considering the fact that there are various ways of approaching object-oriented programming.

Tcl developers have always had easy access to object-oriented programming systems that are well documented, powerful, full featured and extensively used. They probably weren’t built inside the core languages and hence people had no option but to look around for the best alternatives for fulfilling their needs. Else, what seems like a rite of passage for TCL, these developers started writing their own objects, as Tcl made it extremely easy for them to do that!

Considering that there are so many choices available in the marketplace, what should a Tcl programmer do? Well, [incr Tcl] is a pretty mature object system meant for Tcl. What more, it has been around since the 1993 and is modelled after C++ kind of object model. You can even use ‘Snit’ which is particularly great for the Tk widgets (is a part of Tcllib too).