Version 15 of Comparing Tcl with Python

Updated 2005-02-02 21:19:09

LV wrote: Perhaps the community could contribute tips, references, etc. comparing and contrasting Python and Tcl to provide someone who programs in Python assistance in learning to read/write Tcl?


VK My vision of comparing is to start with a following road (feel free to change it and expand on each item in turn, shorten list or adding more items):

  • What are basic types? (hash/array/list/strings) Everything is an object? a string?

Python has all the Tcl types, and has had the equivalent of dicts for some time. 'Everything is a hash table' is perhaps what you could say about how Python's object system works.

  • How OO is different between two languages. Python has one true OO and heavily based on it; Tcl does not have one, but it has many different types of OO as external libraries; what does this brings to language? advantages? disadvantages? (wiki has many about this; link to page would be good) Multiple inheritance?

Python has OO, Tcl does not. This means that all Python extensions can utilize and build on one OO system rather than having to deal with the fractured landscape that Tcl has.

  • What is typical usage of Tcl? of Python? of their combination? Is it Web, GUI, financial, physic computation? what?

Python is used for all kinds of things - possibly a little bit less for quick scripts, as it's certainly slower to write some things in Python than Tcl. Tcl's socket abstraction is, IMO, the best in the business for example.

  • IDE: Several GUI WYSIWYG are in Tcl (Visual Tcl, ...)

Aside from the very high quality ActiveState tools, I do not believe that any of the Tcl tools is much maintained. Python didn't have much until recently, but I believe there are a number of nascent systems that are fairly high quality.

  • IDE2: debugger and ease of use one.
  • What it usually takes to extend functionality in application? (as opposed to commonly used (mis?)conception that Perl programs are write-only)

Tcl's C API is more extensive, and IMO, nicer than Python's. It lets you access more of the underlying system.

  • What does it takes to extend language itself? Is it possible? on the tcl/python level? C level?

Tcl's extremely flexible syntax lets you add new control structures. You can't do that in Python.

  • OS coverage. Both support many platforms. Which coverage is wider?

Probably about the same. Tcl runs on some things like Cisco, although it had to be heavily modified to do that. Python runs on some things like Nokia cell phones: [L1 ]

  • to be continued

Tcl, when it gets things right (sockets, event loop, regexps) has a higher level API that really hits a sweet spot. Python has much more functionality available to it, is very popular and is growing in popularity. Tcl's implementation is nicer in some ways. Things like i18n and threads tend to be 'done right', and are less intrusive than in Python.


Sarnold I have tried a small tutorial, while reading the beginning of the Python tutorial. I have abandoned it, because it was not the subject of this page.


Sarnold All right. In my personal experience, I always used Python for small tasks, so I am not the person who would comment it for large tasks.

I just noted there was overall more than 300 modules in the standard distribution, part of them being platform-specific.


Category Language