modern Tcl and correct quoting

Rainer Müller raimue at macports.org
Thu Jun 13 06:14:14 PDT 2013


On 2013-06-13 00:18, Poor Yorick wrote:
> Putting [expr] arguments in braces can result in much better performance as it
> allows Tcl to cache a byte-coded version of the expression.  It can also avoid unintended processing that might occur via double substitution.  Ref http://wiki.tcl.tk/10225.  

Oh well, I wasn't aware of that. While I doubt the execution speed of
Tcl is in any way a bottle neck for MacPorts, the unintended
substitutions might become important.

Thank you for the detailed explanations. These help to understand the
reasoning for the changes and it makes sense. However, I feel a need to
document this somehow in some sort of style guide such that we can apply
them to new code as well as to the existing code base. I suggest we add
a section on Tcl peculiarities to the HACKING file in base code.

> On to another topic: An alternative to maintaining source-code compatibility
> with Tcl-8.4 would be for macports to include in its distribution its own
> bootstrap version of a newer Tcl.  This could have additional advantages.  For
> example, I'm aware of at least one bug in the Tcl-8.5.7 shipped with Snow
> Leopard  that causes silent data corruption in the running interpreter, and
> I've seen some very perplexing macports bugs reports that may in fact be caused
> by this same bug.

Yes, we had our fun with broken handling of environment variables in
that version.

In any case, Tcl is not the only dependencies MacPorts currently needs,
so I don't see a case to do that solely for Tcl. Self-management or
self-hosting was discussed before but I guess nobody felt a real need to
actually take the hassles to implement it. Given the fact that our
dependency resolution is still quite basic I am not sure whether this
would be feasible at the moment.

Rainer


More information about the macports-dev mailing list