
Idioms: Building High Performance Networking Servers Using Tcl (2006) - ghosthamlet
http://www.maplefish.com/todd/tcl_net_idioms.html
======
davidw
Tcl - doing event loops before event loops were cool.

------
NicoJuicy
I think the article is from 2004 instead of 2006. None the less, i'm wondering
if this statement still stands:

    
    
        Tcl is slower than C, but the network is slower than Tcl.

~~~
ZoFreX
F5 load balancers still use Tcl, albeit a modified and optimised version.

If anyone is reading this article and thinking "Gee, I wish I could get a job
writing Tcl", hit me up.

~~~
ciupicri
For me it's more like gee, I had a job writing Tcl and it was so much "fun".
I've just tried the example from "Read messages chunk by available chunk" and
got:

    
    
        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.

~~~
adunsmoor
Your error looks like there might be an extra space after the line
continuation (backslash) in the example.

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.

~~~
ciupicri
Yes, you're right.

------
smrtinsert
I just picked up PureData and have been enjoying learning about it and sound
generation - also written in tcl/tk!

------
idiom
I know this articles was published 7-8 years ago at
[http://idioms.in](http://idioms.in)

------
regi
"From SMTP filters/routers that handle millions of email deliveries a week to
in-memory message journaling (for redundancy) that handle hundreds of
transactions per second."

I stopped right there. To me, high performance is for instance, handling
millions of emails per minute, thousands or tenth of thousand TPS. This is
high performance, real life performance, not seen only in "physic labs and
university research centers".

Some comments talk about Tcl using select. If this is true, it would mean a
max of 1024 connections in parallel, kind of sad...

~~~
incision
_> 'I stopped right there.'_

This is obnoxious, way too common and as another comment points out seemingly
aloof to the fact that the article is 8 years old.

Please, just to stick to self-promotion [1][2][3][4].

1:
[https://news.ycombinator.com/item?id=6560909](https://news.ycombinator.com/item?id=6560909)
2:
[https://news.ycombinator.com/item?id=6573974](https://news.ycombinator.com/item?id=6573974)
3:
[https://news.ycombinator.com/item?id=8086250](https://news.ycombinator.com/item?id=8086250)
4:
[https://news.ycombinator.com/item?id=8200975](https://news.ycombinator.com/item?id=8200975)

~~~
regi
Oh, so this is your thing right? Checking people's background...
[https://news.ycombinator.com/item?id=8183055](https://news.ycombinator.com/item?id=8183055)

;)

And as I'm saying in following comments, even in 2006, this was poor
performance.

