Tcl the misunderstood (2006)
antirez.com
Tcl the misunderstood (2006)
1–10 of 49 posts
Re: Tcl the misunderstood (2006)
#2Another topic I would like to see introduced in a similarly friendly way is event loops. At my work I am dealing with some Tcl/Tk code that uses event loops and it's a bit of mental gymnastics to get my head around what gets executed when.
Re: Tcl the misunderstood (2006)
#3I never encountered it again, but its elegance always stayed with me. Except for uplevel. Fucking evil.
Re: Tcl the misunderstood (2006)
#4No it doesn't... unless machine translation is "there" and built into Tcl.
> Every string is internally encoded in utf-8, all the string operations are Unicode-safe, including the regular expression engine. Basically, in Tcl programs, encodings are not a problem - they just work
Really? Perl's Unicode support is pretty much second-to-none, IME, but you still need to know the encoding of your file handles and so on. Once it knows this, Perl will Just Work(TM). How is this handled in Tcl?
Re: Tcl the misunderstood (2006)
#5It is an old language with lots of cruft, but it's been used in all sorts of places for something like 25 years. Perhaps people's experiences with the language are colored by using it as a means to customize behavior in some big hairy enterprise app.
Re: Tcl the misunderstood (2006)
#6Re: Tcl the misunderstood (2006)
#7TCL lends easily shell-like syntax so it is great for adapting your DSL to a REPL and even maps fairly cleanly to REST.
Years ago, I built a REST-like API that had one URI to which one could POST a TCL script. That script in its most basic form would be a series of pipelined API calls. There was even limited transactional support. I saw this important for mobile applications as it would reduce latency.
While the scripts were technically TCL, it was easier for developers than Javascript or Ruby (which we also beta'ed). It didn't look as much like a programming language as it did a series of shell commands.
The biggest problem with the above is that TCL safe interpreter still allow loops and other blocking operations. It means that you need to write a reaper to kill long-running threads / processes.
Combining such techniques with ZeroVM (or even Docker, or both) would be interesting.
Re: Tcl the misunderstood (2006)
#8An interesting corollary to concept 5 (the fact that everything in Tcl is a string) is that this means that Tcl is actually homoiconic. It does it completely differently from Lisp, but still ends up in the same place: code and data have the same representation.
Everything else about web service backends in TCL is pretty sad and frustrating, though. Unless it's embedded, anyway.
Re: Tcl the misunderstood (2006)
#9Back at the beginning of time I worked with Vignette StoryServer, which spun out of aolserver, one of the first "database-backed dynamic website" servers. The scripting language was TCL 7.something. I never encountered it again, but its elegance always stayed with me. Except for uplevel. Fucking evil.