Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TCL is great at being an embedded language, especially when you want something that looks like a DSL using safe-interpreters. (Basically, these are sandboxed interpreters with access to limited built-ins, plus any methods you might inject into the global namespace)

TCL 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.



Since Tcl 8.5 (Dec 2007) interps have timed resource limits available for them.

  bch$ tclsh8.5
  % interp limit {} time -seconds [expr {[clock seconds] + 15}]
  % while 1 {set a 9} ;# 15s elapse, then...
  time limit exceeded
  bch$

edit: Add release date for Tcl 8.5




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: