← Back to context

Comment by jrapdx3

13 days ago

For the record, Tcl doesn't use garbage collection, rather objects are reference-counted and freed when ref count is <= 0.

But interestingly, Tcl is a good example of languages that took a piece of Lisp's domain. In fact, Tcl is quite Lisp-like with a syntax distinct from Lisp. Tcl has been successful and with the recent release of v. 9.0, it stands to gain traction among programmers.

OTOH CL and Scheme remain underused though current implementations are generally well-equipped to handle contemporary requirements. I've used Scheme to build website generators and other tools but there's a dearth of large-scale, visible Lisp/Scheme projects out there to attract developers.

Starting such a project is a big commitment, probably programmers are hoping somebody else will pick up the ball and run with it.

Ref counting is garbage collection (cf https://courses.cs.washington.edu/courses/cse590p/05au/p50-b...). It's just not tracing garbage collection.

I'm a decent fan of both Tcl and CL, but Tcl has the big problem of being "almost" homoiconic and lacking good meta-programming tools like quasi-quoting. I say almost because comments break homoiconicity, whereas in CL they are discarded at read-time, never appearing in the parsed tree.

  • Quasiquoting is only necessary in Lisp because Lisp evaluates its arguments by default. Tcl does not do that.

    • Quasiquoting allows us to specify a mostly fixed template of code where we would like to indicate variable parts that are to be substituted (note: not evaluated).

      The stuff here sure looks like quasiquoting to me:

      https://wiki.tcl-lang.org/page/Macro+Facility+for+Tcl

        mac  mloop {idx cnt cmd} {
           return "for {set $idx 0} {\$[set $idx] < $cnt} {incr $idx} {$cmd}"
        }
      

      The "..." with embedded $... reference is is a kind of quasiquote.