unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: python-on-guile
Date: Sat, 19 Feb 2022 20:36:39 +0100	[thread overview]
Message-ID: <CAGua6m1oKSp0N60_CwO=gpair2P7KNAE3yX1+ND=jKoxtLGHig@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2220 bytes --]

             reply	other threads:[~2022-02-19 19:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19 19:36 Stefan Israelsson Tampe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-23 15:00 Python-on-guile Mikael Djurfeldt
2021-04-23 20:41 ` Python-on-guile Linus Björnstam
2021-04-24 10:04 ` Python-on-guile Mikael Djurfeldt
2021-04-24 11:26   ` Python-on-guile Stefan Israelsson Tampe
2021-04-24 12:59     ` Python-on-guile Stefan Israelsson Tampe
2021-04-24 14:41       ` Python-on-guile Stefan Israelsson Tampe
2021-04-24 15:19         ` Python-on-guile Stefan Israelsson Tampe
2021-04-25  8:20           ` Python-on-guile Mikael Djurfeldt
2021-04-25 10:21             ` Python-on-guile Stefan Israelsson Tampe
2021-04-25  8:46           ` Python-on-guile Stefan Israelsson Tampe
2021-04-25 10:54       ` Python-on-guile Dr. Arne Babenhauserheide
2021-04-25 11:54         ` Python-on-guile Vivien Kraus via General Guile related discussions
2021-04-25 10:18 ` Python-on-guile Stefan Israelsson Tampe
2021-04-27 12:29 ` Python-on-guile Nala Ginrut
2019-06-14 18:06 python-on-guile Stefan Israelsson Tampe
2019-06-22 21:07 ` python-on-guile Arne Babenhauserheide
2019-06-26 18:45 ` python-on-guile Nala Ginrut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGua6m1oKSp0N60_CwO=gpair2P7KNAE3yX1+ND=jKoxtLGHig@mail.gmail.com' \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).