2 ms·
I wouldn't call Tcl "innately async" like, for example, Erlang. Tcl is a command-based, imperative language. Tcl has threads. They work mostly like you'd expe
by sshine 8y ago
I wouldn't call Tcl "innately async" like, for example, Erlang.
Tcl is a command-based, imperative language. Tcl has threads.
They work mostly like you'd expect: shared variables, mutexes, condition variables.
Threads can send script code to another thread using thread::send -async and thread::broadcast:
https://www.tcl.tk/man/tcl/ThreadCmd/thread.htm#M17 https://www.tcl.tk/man/tcl/ThreadCmd/thread.htm#M17
Tcl does let you write DSL-like libraries, and because you can easily hotswap code (being homoiconic like Lisp), it also works well for distributing your execution environment across several network nodes.
But the language itself isn't "innately async". The thread model isn't based on message passing, CSP, Pi calculus, or any other strong idea. I always thought of it as "string-focused Lisp".