4 ms·
I can’t believe I’m praising Tcl
- astrec 19y agoTcl isn't that bad. We've got a few web apps running quite happily on AOLServer. In the late 90s/2000 AOLServer was a country mile ahead of everything else.
- deathbyzen 19y agoAm I the only human being alive that reads articles like these and has next to no experience programming? I read the whole thing and got the gist of it, but I'm not a programmer. Still, I find rants, tips, and other things of this nature enthralling reads.
- donal 19y agoBe careful! That might lead you down the path of <gasp> learning to program, or worse liking programming, or even worse yet changing jobs so that you program full-time. Pretty much the path I took. Though, seems to be working out, particularly with some startup plans slowly taking shape.
- meredydd 19y agoOkay, okay, I'll bite. Hear me, before the rotten tomatoes hit: I. like. TCL. In fact, I'm going to go out on a dangerous limb and say that complaining about the [expr] syntax - which seems to be his only concrete complaint in the whole article - reminds me of nothing so much as saying, "But Lisp is horrible - look at all those parentheses!" You've heard the trope that languages, as they get more advanced, begin to resemble Lisp? PG reckons we've seen every other feature but macros, but I beg to differ. TCL is the only other language I've ever used where I could be coding, spot a common pattern, and just define a first-class construct that lets me go: with-db-transaction conn { select_1_or_error $conn "SELECT ..." ... } Sure, TCL lacks a heap, and garbage collection, which make it untenable for big programs. But if there's one thing Lisp should have taught you, it's that an initially ugly syntax is often hiding something truly golden.
- mechanical_fish 19y agoHave you worked with the ACS (ArsDigita Community System), and/or with AOLserver? Or have you and the ACS simply converged on the obvious idiom? ACS code looked a lot like what you just typed. In the hands of a bunch of Lisp programmers from MIT, Tcl could really be made to sing. It had, at best, the same relationship to Lisp that PHP has to Perl... but IMHO it was a much better Web programming language than PHP, if only because the designers were a bit more careful to avoid inane inconsistencies.
- davidw 19y agoIt's faster than PHP too, or it was several years ago. Rivet blew PHP out of the water in my benchmarks.
- meredydd 19y agoActually, that was a custom app built on the tcl httpd (whose procs-as-paths structure was a revelation to me at the time). I also did some fun things like a Java-style try/catch/finally system, which was useful when playing with xmlrpc. (Plus, the rest of that distributed system is in Java, so it felt like a nice idiom). I gently dispute your "bunch of Lisp programmers from MIT" characterisation - but only gently, because I know what you mean. TCL can give you The Macro Enlightenment (aka, "Oh, that's what 'code is data' means") before ever seeing Lisp - after which, of course, Lisp macros feel conceptually familiar - but the latter is definitely n times more powerful.
- mechanical_fish 19y agoI gently dispute your "bunch of Lisp programmers from MIT" characterisation... You mean as a characterization of you... or as a characterization of the folks who founded ArsDigita, which is what I intended? In either case, a gentle disputation is probably justified. :)
- menloparkbum 19y agoThe reason why ACS was any good was because AOLServer was an awesome multithreaded webserver with a great API. Tcl was only there because it was the easiest language to embed into a multithreaded app at the time (now that distinction goes to lua). I'm not sure the Tcl code in the ACS was a good example of anything... in places it was as bad as the worst Perl script you have seen. (I know, I probably wrote 20% of the codebase.)
- systems 19y agoTcl have uniform syntax Tcl have a small number of basic concept that you can learn in a very small amount of time Tcl allow you to easily create new commands that look just like built-in commands Tcl have uniform syntax, yes again. I love this about Tcl.
- DocSavage 19y agoThis excellent article helped changed my thinking about Tcl: http://antirez.com/articoli/tclmisunderstood.html http://antirez.com/articoli/tclmisunderstood.html I had to use Tcl for a large scientific software system and grew to like its strengths. There's something to be said about an overly simple syntax and nice coupling to C.
- tptacek 19y agoTcl had a bunch of things going for it that made it an excellent embedding language: a lightweight runtime, simple, consistent semantics, and (for the time) an excellent C API.
- ojbyrne 19y agoI think I judge languages by slightly different criteria from the rest of the people here. Tcl got me 2 jobs. So I can't help but praise it.
- ken 19y agoSo I learned Lisp long before either Tcl or a "pop infix" language. Common Lisp has it all, and then some. I learned Python and Tcl at roughly the same time. It looks to me like Python and Tcl got in a big tug-o'-war fight over Lisp's features, and the rope broke and each got half. Python ended up with the data structures, but not the syntax. Tcl ended up with the syntax, but not the data structures. And advocates on both sides scream "how can you do anything without #{feature_x}?". And I say "ah, Lisp has both!", and everybody gets together and says "oh, shut up, you".
- jcl 19y agoIf you'd like Lisp without parens, how about Logo? Logo seems like Forth backwards: prefix instead of postfix; neither language needs parens for function calls because they both know how many arguments each function call uses.