4 ms·
It's apt to compare Tcl to Node.JS because of the similar I/O-model. Tcl is slower than Node.JS (a broad statement, but e.g., it's not JITed), and the last tim
by sebcat 12y ago
It's apt to compare Tcl to Node.JS because of the similar I/O-model.
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.
- justincormack 12y agoThe similar IO model? It is just the Unix IO model though, with the caveat to never use blocking IO. Tcl doesn't force non blocking IO like Node, you have to do it yourself. 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 http://www.kegel.com/c10k.html
- sebcat 12y agoBoth Tcl and Node.JS are built around the concept of an event loop. The preffered way to do IO in both languages is to express your network application as a FSM with callbacks on state transitions. Of course event driven IO is not in any way "owned" by either languages, what I mean is that they both encourage an event-driven IO model. Am I making myself clear?