i am now experimenting with the new generator infrastructure to see how
much actual python on guile code is sped up. In the process I am optimizing
a lot of stuff regarding python for loops. But some irritating things
remain.

My number 1 anger is that a iterator can throw an exception as a way to end
a loop. And then at a final step all loop data has to be available so in a
functional style you now need to have the catch frame that is internal.
Currently we have the cludge of wither use known safe iterations, like over
a list of values or a range or a known safe generator. More general code
needs to play with a pletoria of set! actions in order to transfer data out
of scope. Horrible!!!

But what about this solution just make a generator that returns all values
so that you can keep track of em and just issue the finishing command with
it.

(define internalGenerator
    (lambda ()
         (pause)
         (catch 'StopIteration
                (lambda ()
                     (let lp ((s s0) ...)
                        (return x ... s ...)
                         (let ((xx (next I)) ...)
                              (let ((x xx) ...)

                                  code ...
                                  (lp snew ...))))
                       (return 'finished)
                  (lambda xxx (return 'finished))))))

We know that the generator over head in the loop is quite small just 3-4x
the speediest loop guile perform. with this we get non set! operations that
are very performant. But not only this we might get continue to work
speedily as well
        • Re: ... Stefan Israelsson Tampe
          • ... Stefan Israelsson Tampe
            • ... Stefan Israelsson Tampe
              • ... Mikael Djurfeldt
              • ... Stefan Israelsson Tampe
              • ... Stefan Israelsson Tampe
          • ... Dr. Arne Babenhauserheide
            • ... Developers list for Guile, the GNU extensibility library
    • Re: Python-o... Stefan Israelsson Tampe
    • Re: Python-o... Nala Ginrut
  • python-on-guile Stefan Israelsson Tampe

Reply via email to