From: jerry <jdinardo@nycap.rr.com>
To: Christopher Lam <christopher.lck@gmail.com>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: guile style
Date: Sat, 19 Jun 2021 08:16:39 -0400 [thread overview]
Message-ID: <1e959322-f5f8-9bc3-ae08-a30165f9f409@nycap.rr.com> (raw)
In-Reply-To: <CAKVAZZKUTHD9Tv82m=_Ar_QjP+tmDkMwAo_Gf6QHgsXqsimb2w@mail.gmail.com>
On 6/19/21 7:20 AM, Christopher Lam wrote:
> Agree set! is not a desirable form. It is not consistently optimisable.
> I cannot find the reference in the manual.
>
> Also consider the first form: you're building a list in 3 passes -- call
> iota to generate a list, call filter to navigate the list again, then
> fold to accumulate your answer. Therefore it's O(3N).
>
> The preferred form is definitely from the little schemer.
>
Haskell has something called stream fusion which can optimize the extra
passes out in many cases. I wonder if Guile or any of the other scheme
compilers can do that? As someone who has spent the majority of my life
writing high performance C and Fortran code, the inefficiencies in a lot
of functional programming is something I don't care for. On the other
hand, writing functional code is fun.
next prev parent reply other threads:[~2021-06-19 12:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-19 0:55 guile style jerry
2021-06-19 10:25 ` Tim Van den Langenbergh
[not found] ` <CAGua6m1HSYGP6i60Qyj=sVAgeriOzZmb1abCtoxnTQQiOgyY-Q@mail.gmail.com>
2021-06-19 11:24 ` Fwd: " Stefan Israelsson Tampe
2021-06-19 11:31 ` jerry
2021-06-19 11:17 ` Ricardo Wurmus
2021-06-19 11:20 ` Christopher Lam
2021-06-19 12:16 ` jerry [this message]
2021-06-19 17:02 ` Zelphir Kaltstahl
2021-06-19 17:59 ` Linus Björnstam
2021-06-20 2:21 ` jerry
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=1e959322-f5f8-9bc3-ae08-a30165f9f409@nycap.rr.com \
--to=jdinardo@nycap.rr.com \
--cc=christopher.lck@gmail.com \
--cc=guile-user@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).