Re:Tcl for Web Nerds
by ewindisch on Thursday February 12, 2015 @04:23PM
(#9041478)
I've used TCL embedded in other languages as a routing framework for HTTP requests. Note that TCL has a restricted sandbox mode which makes this fairly safe, if implemented correctly. It might sound silly, but it's forward-polish notation which matches both shell and REST semantics.
Using TCL, it is possible to write an app which has a CLI client which matching the REST interface and can interpret written scripts. This has proven to be quite powerful in my experience.
The other thing is that embedded language sandboxes usually aren't so different that supporting other languages for scripting operations isn't a big deal. Where I used this, it was also possible to POST javascript to the server to batch execute API commands that would otherwise have to be performed via REST. Our client-side javascript API worked the same as the server-side API, so code could be written and run locally, or shipped to the server for batch processing.
Re:Tcl for Web Nerds
by alricb on Thursday February 12, 2015 @07:27PM
(#9042212)
Note that the reason Greenspun used TCL was because it was used by AOLServer: "AOLserver was the first HTTP server program to combine multithreading, a built-in scripting language, and the pooling of persistent database connections." [1]
Using TCL, it is possible to write an app which has a CLI client which matching the REST interface and can interpret written scripts. This has proven to be quite powerful in my experience.
The other thing is that embedded language sandboxes usually aren't so different that supporting other languages for scripting operations isn't a big deal. Where I used this, it was also possible to POST javascript to the server to batch execute API commands that would otherwise have to be performed via REST. Our client-side javascript API worked the same as the server-side API, so code could be written and run locally, or shipped to the server for batch processing.
If you want to code in TCL for the web, we'd love to hear from you.
[1]: http://en.wikipedia.org/wiki/AOLserver