Tcl is slower than C, but the network is slower than Tcl. Tcl is slower than C, but the network is slower than Tcl.If anyone is reading this article and thinking "Gee, I wish I could get a job writing Tcl", hit me up.
invalid command name "handle_data sock4"
while executing
"[list handle_data $chan] "
(procedure "handle_client" line 8)
invoked from within
"handle_client sock4 127.0.0.1 40642"
I replaced [list handle_data $chan] with a plain handle_data $chan, but then another bug come up: invalid command name "buf"
while executing
"buf sock4,data_ready write"
(write trace on "buf(sock4,data_ready)")
invoked from within
"set buf($chan,data_ready) 0"
(procedure "handle_data" line 4)
The fun never stops :-) In a way Tcl makes shell scripting (Bash) look wonderful because at least there you can't expect much from it, whereas Tcl presents itself more like a "real", full-blown programming language.The trace command is split in to 2 lines for readability but the web page's formatting introduced a hidden space if you try to copy/paste the example in to a tcl script.
Tcl is slower than Node.JS (a broad statement, but e.g., it's not JITed), and the last time I checked Tcl's event loop was select-based and not epoll/kqueue-based. Looking at the code for 8.6.2, it appears to be like that still.
I like Tcl, but I wouldn't use it for high-concurrency tasks (I would use Go for that). It's nice when you need a DSL to extend your application, or if you want to glue C libraries together, but there are better tools for network code.
Event based IO was around by 1999 or earlier, according to the C10k page that we all avidly read backin the day http://www.kegel.com/c10k.html
Am I making myself clear?