IRC channel logs
2025-08-27.log
back to list of logs
<dsmith>cow_2001, So. If that response has a Content-Length header, the "port" returned is a delimited port. It's already been read and the data is in a bytevector. <dsmith>cow_2001, See response-body-port in module/web/response.scm <dsmith>wingo, Do you know of a good way to get the response body port into the stdin of a spawned process? <dsmith>wingo, When the response has a Content-Length header? <lloda>whereiseveryone: defining where as (if ... (begin ...)) isn't 'wrong', the reason guile defines it as (if ... (let () ...)) is so that you can put defines in the body. <pinoaffe>hi folks, how do you extend guild with additional commands/scripts? I couldn't find any instructions in the manual <old>is it possible to match the last two elements of a list? <mwette>pinoaffe: put guild scripts in a directory scripts/ under some path that exists in %load-path; your script should be a module with main defined <lloda>old: (import (ice-9 match)) (match '(1 2 3) ((z ... pen ult) (vector pen ult))) ? <old>lloda: right .. I was doing that but forgot the import ice-9 match in the REPL .. <old>giving me a syntax error about ellipsis <old>yes. I'm starting to know some error very well <old>"Ah yes that cryptic message is about missing (ice-9 match)" <old>shall be in top-3 of Guile F.A.Q <cow_2001>dsmith: that's approximately what i did with pipeline :< now i have a new problem which is using "sonic" to increase or decrease the speed of the sound <cow_2001>dsmith: sonic needs a file, i think, so i would have to write it to /run/shm/ or something <dsmith>Well, I learned a bit about http response ports.. <cow_2001>and it is still strange that #:streaming? #t is not really streaming? or maybe what you've read about a bytevector was just the buffer in between the socket and the port <cow_2001>and now i have another problem - how do you clean up temporary /run/shm/tts-XXXXX.wav files when the ",tts.scm" script may close at any point because greader-mode mode just closes it and opens a new ",tts.scm" each time you move the emacs point around <dsmith>Yeah, I was surprised that :streaming #t doesn't always return a file descriptor. It *does* return a port, but that's a port to some in-memory bytevector. <dsmith>And of course an external process can only read from a fd, not some in-memory buffer of a different process. <fnat>What would you recommend to start using Guile Haunt? That I take the current master (0.4.0, although a 0.4.0 Git tag has yet to be created, I think) or that I stick to what packaged in Guix, i.e. 0.3.0? <fnat>There seems to be a breaking change at some point between the two versions (commit 00397d0a5707c85e6054a4d64b0520f1e1f96e93), so I thought I might as well start with 0.4.0 - especially if the plan is to tag it and release it soon-ish. <cow_2001>dsmith: maybe there is a way of doing something like (make-a-port-with-a-file-descriptor-from-a-regular-port response-body)? <dsmith>might be possible with splice. Not sure if Guile exposes that <dsmith>Actuually, it's vmsplice I'm thinking of <cow_2001>i've been reading crafting interpreters because it's basically a literate programming C program, but it is also very bare bones <dsmith>vmsplice is tricksy becuse there is a shared bit of memory that you can't touch until the thing piped is done with it. How do you know when it's done? When can I free it or re-use it? <old>dsmith: shared memory is for that? <old>what's the use case here? I might be able to help <dsmith>old, Oh, just rambling. Thinking of ways to efficiently move data from one port to pipe/fd when the "port" is not a fd but a bytevector wrapped in a custom port. <dsmith>old, cow_2001 was wanting to pass an http result stream to a spawned process. But the result "stream" didn't have a fd. <old>if you can have the pointer of the bytevector <old>you could open /proc/self/mem <old>and offset the resulting fd to the address of the bv <old>not sure if splice would work with it tho <cow_2001>i have one patch i would like to send to guile. there are some procedures which take parameters "a" for the first and "b" for the second. you do not know what role they take because they are named "a" and "b". i want to rename them to something meaningful <cow_2001>oh, for example - string-contains's first two parameters are named s1 and s2 <cow_2001>which one contains which? you cannot know that just by looking at the names <old>I agree. I always have to lookup the info man page to make sure which one is which <rlb>I'm not sure, but if we were going to do a lot of those, I might prefer waiting until after we settle the utf-8 issue because that's a long complicated series that would probably have many rebase conflicts with those changes. <rlb>(from my perspective) <old>(string-contains haystack needle) <rlb>Though I also don't know what the liklihood is that the utf-8 changes will be adopted -- if/when we get to them, it'll take some time just remembering what I was doing. <rlb>(iirc wingo suggested waiting until wip-whippet is ready and then putting it there as part of 4.0) <identity>if you un-prefix it, it will be (s1 string-contains s2), or s1.contains(s2), if you will. a good guideline for both guessing and designing interfaces <rlb>...but on the other hand, it's been pending a couple of years now, so of course it shouldn't hold up "other things" indefinitely -- suppose it depends on how soon it might be able to move forward. <old>identity: that's my trick for `-' <old>but same thing: (< a b) <=> a < b <dsmith>old, vmsplice is memory->pipe or pipe->memory <old>I thought it was only mem->mem <old>but from different address space <dsmith>old, An can move the ownwership of the pages from one proc to the next. <old>there's also process_vm_writev that could be useful <dsmith>The beauty of pipes is they are so compose-able. Random programs written decades apart can be combined together to do useful stuff. <fnat>dthompson: Hi! I'm looking at using Haunt for one of my projects. I wonder whether I should stick to what's available in Guix (0.3.0) or if perhaps I should jump to 0.4.0. Is there any plan to release 0.4.0 or, contrarily, any caveat I should be aware of?