guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile style


From: jerry
Subject: Re: guile style
Date: Sat, 19 Jun 2021 08:16:39 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]