calvin-brand-light-mode
calvin-brand-dark-mode
∕
⌘K
About Calvin Podcast We Can Do This Book Speaking
aAbout Calvin
Podcast
wWe Can Do This Book
sSpeaking
Back

Breaking news: Tcl considered lacking in some areas

Other
Calvin Correli·Jan 19, 2005· 2 minutes
As I am doing programming in Tcl and Ruby side by side, I am noticing some important (if obvious) differences.

One of them is how, with Ruby (or any OO language), you can easily do lazy computation, simply using methods on objects. Nothing earth-shattering here (move along, please), but since Tcl does not have objects I find myself passing around arrays as a poor-man’s version of objects. But that requires that I calculate all values up-front, instead of only as needed. An obvious performance loss, not to mention a nuisance because you have to worry more about any overhead you are adding.

(There are ways around this, such as having attributes actually be procedure calls, so you say [$item(url)] instead of $item(url), but that has other drawbacks, including not working naturally with the templating system I am using.)

Also, now that I have gotten used to developing in Ruby, I keep bumping into instances where Ruby has simple constructs that saves me several lines of code. A classic example, that I cannot believe Tcl does not have: Array#collect. When you want to process each element of a list (such as adding quotes around them before using them in an IN clause in a SQL statement), you have to write 5 lines of code for what in Ruby is just types.collect { |e| ”’#{e}’” }.join(”, “).

There are many more and far deeper differences going on, but these are the ones I happened to be experiencing tonight, as I am sitting here ate De Balie, developing this CMS for Greenpeace.

Previous Sorry isn't quite enough
Next Wi-Fi in Amsterdam

Comments

Write a comment...
00:00 Recording...
calvin-brand-light-mode
calvin-brand-dark-mode
1 Chestnut Hill Plaza #1139
Newark, DE 19713
United States
Copyright © 2026 Calvin Correli
powered by