Re: TclX loop slow in the default case



On Aug 27, 7:41 pm, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
...
As you know of course, the near 3x speed gain for [for] is due to
bytecode compilation of its body, while TclX's [loop] command calls
Tcl_EvalObj at each turn.

This experiment IMO fuels the idea that preprocessing could help in
Tcl too from time to time: it would allow to define countless such
variants of Tcl's optimized control primitives without losing the
performance.

I couldn't agree more.

Notice that if you're bold enough to ignore fears of string collision,
you can define a variant of proc that does dangerous-yet-useful regexp
parsing. Here you can use [regexp] just to locate the [loop] word, and
then [info complete] to properly find the boundaries of the statement.
Then it's just a matter of substituting the equivalent [for]
incantation...

I'm going to be looking at this method as well as some of the 'macro'
techniques available on the wiki. Baby steps just now ... but this
language is addictive.

Cheers.
Evil Son.
.



Relevant Pages

  • Re: almquist shell variants
    ... not a complete log (except for the variants without any changlogs). ... "A reimplementation of the System V shell". ... no command line editing and history ... parameter expansion doesn't know # and % ...
    (comp.unix.shell)
  • Re: OT: Rumsfeld Resigns!
    ... no active-duty serviceman can publicly criticize his chain ... of command. ... But the "Times" variants are closely tied to the military ...
    (rec.arts.comics.strips)
  • Re: expr in 8.5.0
    ... following variants of the for loop: ... where the "expr" command is missing? ... missing operand at _@_ ...
    (comp.lang.tcl)
  • Re: DO...LOOP implimentation
    ... that's pretty cumbersome. ... I doubt you can come up with enough variants to cover all required cases ... DO LOOP combines a counted loop with a very crippled kind of local ... Then again, AFAIK there already are extensions for local variables, but ...
    (comp.lang.forth)
  • Re: DO...LOOP implimentation
    ... that's pretty cumbersome. ... I doubt you can come up with enough variants to cover all required cases ... Something like Postscripts loop operators, which push the ... M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html ...
    (comp.lang.forth)