IRC channel logs
2018-01-23.log
back to list of logs
<enderby>is there a better way to lookup srfi's (than looking in the guile manual) while in a scheme buffer with geiser running <manumanumanu>I am pretty satisfied today. My low-level (ffi) bindings for libsodium is nearing completeness, and some high level stuff is written already. <manumanumanu>Then I'm going to write some extra fluff on top that lets you use crypto_box and secretbox with xchacha20 so you can use random nonces <manumanumanu>No releases in any time soon. Will have to compare it to some test vectors first :) Anyway, I am pretty happy with how it is rolling along. Whenever my kid sleeps, I manage to write another couple of scheme wrappers :D <manumanumanu>wingo: when you are apparently here: am I right in assuming that call-with-values is slower than <manumanumanu>Guile seems to have pretty big overhead working with multiple return values <manumanumanu>Of course it is slower in one aspect (an extra layer), but I wonder if the penalty for multiple values is bigger than that <amz3>manumanumanu: what do you plan to do with libsodium bindings? <amz3>make it work the make it fast ™ <wingo>manumanumanu: call-with-values is not necessarily slower <wingo>if the caller and callee are well-known, e.g. (call-with-values (lambda () (if x (values 1 2) (values 3 4))) (lambda (x y) (+ x y))), then it is free <wingo>rather than caller and callee <wingo>if the producer is unknown, there are two cases <wingo>e.g. (call-with-values f (lambda (x y) (+ x y))) <wingo>one, the producer is scheme, e.g. (lambda () (values 1 2)) <wingo>in that case it is less efficient relative to being inlined but still fast -- about the cost of an out-of-line call instead of inline control flow <wingo>if the producer is a primitive written in C, then it is more expensive. has to allocate a values object then destructure it. <wingo>finally if the consumer arity effectively has a rest argument, as in (call-with-values f +), then the consumer continuation conses up the values into a list <wingo>which is more expensive obviously <wingo>anyway i would say that multiple values in guile are as close to free as they can be. only bad case is if there is allocation, and that is not common <civodul>i'm unclear whether to use fiber's concurrent web server or its web server backend <civodul>given that my top-level is already within 'run-fibers' <manumanumanu>wingo: thanks! Then I have to look for performance issues elsewhere :D I't might be that the optimizer doesn't fare as well with my code where let-values can't be optimized away. I just blamed call-with-values, but maybe I can do something to make the optimizer more happy.