5

TCL is a nice simple programming language, but does not seem to get the credit and/or respect it deserves. I learned it back in 1995 in college and promptly forgot about it only to stumble upon it again recently. I am mostly interested TCL for developing TCP-based network services as well as for web development.

It has been mentioned that TCL makes network programming simple. However, it seems that TCL uses select() under the covers which does not scale well with "web scale" in mind (see the C10K problem). I have searched for support for libevent, libev, raw epoll/kqueue but I don't see much.

Do you know of any "modern" (for lack of a better term) event-based network services written in TCL? Do you have any pointers, tips, or best practices for TCL-based server development?

Thanks!

Johannes Kuhn
  • 14,778
  • 4
  • 49
  • 73
z8000
  • 3,715
  • 3
  • 29
  • 37

1 Answers1

2

There's discussion of this on comp.lang.tcl last year and it appears that the status is: "The core team is thinking about it":

http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/ce3a82f8a13d35fa/f57cea952ab69ecd

For web servers there is AOLserver which implements poll() under the covers. Of course, you can also run mod_tcl/rivet/websh under Apache.

slebetman
  • 109,858
  • 19
  • 140
  • 171
  • Wow. The posters to that thread are very old school. There was one post in which someone was concerned about epoll not being portable. I think we have collectively solved this issue. Or, they could use libevent or libev even. Hmmm – z8000 Jan 25 '10 at 02:12
  • Yes, tcl developers are very, very, (very\*10) conservative. Also some tcl users. Some of us still run tcl on hardware with only 32MB of RAM (Things that used to be considered servers and workstations). On the plus side, I've got tcl code written in 1999 that I can run on the latest interpreter without change ;-) Also, epoll *is* non-portable from tcl's standpoint. This is a language that can run on more devices than Java - Cisco routers for example. – slebetman Jan 25 '10 at 02:29
  • Ok good to know about conservativism. But, surely TCL does not only have solely least common denominator features does it? – z8000 Jan 25 '10 at 02:47
  • Most Tcl core developers are both conservative — we don't want to break others' code! — and holding down other jobs too. On the specific topic of C10K, the main issue is that the (small!) piece of code at the core of our event system — the notifier — is based on `select()` on Unix; we know that needs to change, but it's non-trivial given that dealing with the issue requires removing internal assumptions from the unix notifier. (Personally, it also doesn't help that I'm on an old platform where the alternatives have critical bugs, making real testing practically impossible. But that's just me…) – Donal Fellows May 26 '13 at 07:34