4 ms·
Tcl for Web Nerds (2011)
- MaxBarraclough 6y agoSee also yesterday's discussion on the Tcl language, Why I'm Tcl-Ish: https://news.ycombinator.com/item?id=24897326 https://news.ycombinator.com/item?id=24897326
- marttt 6y agoYes, that's how I found out about Jim Tcl, an actively maintained Tcl implementation in 100-200kB: http://jim.tcl.tk/index.html/doc/www/www/ http://jim.tcl.tk/index.html/doc/www/www/
- 7373737373 6y agoI like Tcl for its sandboxing capabilities: "Tcl added sandboxed subinterpreters in a bid to become a safe web scripting language. The plan didn't work out but it is a killer feature for untrusted input." - https://news.ycombinator.com/item?id=23145448 https://news.ycombinator.com/item?id=23145448
- VBprogrammer 6y agoIt was a long time ago but TCL was the only time in my career where I had to worry about nonsense like double substitution causing arbitrary code execution or numbers being passed with a 0 prefix being handled as octal. It was a pain in the backside.
- seg_lol 6y agoBut then you switched to Javascript and all those problems melted away.
- andrewshadura 6y agoThis is rather old: % factorial 145 8047926057471991944849029257798062771099974390075006163447452810471154123736465 2141085048187983964922743929823029891501981310822165166365957244160940855691773 9149315905992811411866635786075524601835815642793302504243200000000000000000000 000000000000000 %
- ufo 6y agoOne thing that annoyed me a bit with Tcl is that tclsh doesn't come with readline support, meaning you can't go back to previous commands using the up arrow. However, you can work around that using rlwrap. alias tclsh=rlwrap tclsh
- mjard 6y agohttps://en.wikipedia.org/wiki/GNU_Readline#Choice_of_the_GPL_as_GNU_Readline%27s_license https://en.wikipedia.org/wiki/GNU_Readline#Choice_of_the_GPL...
- snazz 6y agoI wish more permissively-licensed projects used libedit instead of requiring their users to use rlwrap. It could be a simple choice for package maintainers at compile-time.
- phaedryx 6y agoWow, this takes me back. My first job used OpenACS and AOLServer. We ended up converting everything to Ruby on Rails (1.16) because development had slowed so much and it was hard to find new developers, documentation, and other resources. TCL was certainly an interesting language.
- ovi256 6y agoFor anyone not familiar with Philip Greenspun (he of Greenspun's Tenth Law fame) this is a good example of this writing and humor: > e.g., (set! ten-factorial (factorial 10)) (set! checking-account-balance (+ 25 34 86)) (print "If you're so smart, why aren't you rich like Bill Gates?") will set ten-factorial to the result of evaluating the factorial procedure with an argument of 10, then compute a graduate student's checking account balance, then print out some career advice to a computer science graduate student.
- dmux 6y agoI would also highly recommend Greenspun's Software Engineering for Internet Application ("SEIA") [0] and in particular the metadata section of that book [1] wherein he goes over defining an ontology of a system, implementing a metadata model in SQL and then generating code based on that metadata model. [0] https://philip.greenspun.com/seia/ https://philip.greenspun.com/seia/ [1] https://philip.greenspun.com/seia/metadata https://philip.greenspun.com/seia/metadata
- cmacleod4 6y agoThis is pretty old, but still has some useful introductory info. Be aware that the documentation links point to Tcl 8.4 which is now obsolete, the current version is Tcl 8.6. For a simple contemporary Tcl/web framework, take a look at Wapp - https://wapp.tcl.tk/home/doc/trunk/README.md https://wapp.tcl.tk/home/doc/trunk/README.md