‹ BackHN Continuity

Thread

Tcl/Tk 9.1

304 points · 144 comments · dmux

  1. qalmakka · · focus · HN ↗
    Tcl is way too smart of a language for its own good. I love how everything is a string or can be hacked on a string, so you can basically do levels of metaprogramming that reach unheard of levels
    1. srean · · focus · HN ↗
      Not to mention uplevels and upvar.
      1. RHSeeger · · focus · HN ↗
        I've always thought of Tcl as a type of Lisp. Clearly, the relationship isn't direct, but it allows a lot of the same things that Lisps do. Plus, the way one nests commands is similar.

        And it shares a lot of the same metaprogramming that Lisps have - more so than the vast majority of other languages.

        1. BoingBoomTschak · · focus · HN ↗
          As someone who did enough of both (in fact, Tcl was my gateway to Lisp), I'd say yes and no.

          Classical Lisp (Scheme/CL) has much more elegant core concepts/semantics, but often much more clunky stdlibs and small/outdated batteries. This shows in unexpected places like the way homoiconicity has a big caveat: comments break the "code as tree" contract, forcing you to revert back to the useless "code as string" middle ages.

          I know that because I had a need to hack together an horrible replacement for the thing I miss the most from Lisp: quasiquoting (<a href="https:&#x2F;&#x2F;git.sr.ht&#x2F;~q3cpma&#x2F;tcl-misc&#x2F;tree&#x2F;e4ba1bb4fcca729337b9a728455c9600cb5a56be&#x2F;item&#x2F;util.tcl#L40" rel="nofollow">https:&#x2F;&#x2F;git.sr.ht&#x2F;~q3cpma&#x2F;tcl-misc&#x2F;tree&#x2F;e4ba1bb4fcca729337b9...).

          ------

          So, despite the fact that I&#x27;d probably recommend Janet to people who want Tcl without Tk, these days, I still like it. Do note that compared to its competitors (Ruby, Python, Perl), its POSIX support is _really_ bad. There&#x27;s no way in core to do signal handling or open a UNIX socket (and dead TclX that doesn&#x27;t use namespaces isn&#x27;t a replacement). Even SBCL has sb-posix.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.