IRC channel logs

2025-01-05.log

back to list of logs

<lechner>Hi, I wrote a procedure to find duplicates comparing adjacent elements after sorting. Is something like it available from a standard library? Thanks! https://bpa.st/HMIQ
<lechner>Hi, can a syntax-case fender produce a more meaningful error message, especially when checking multiple syntax objects with 'and'?
<amano>How do I wait for the first value from multiple data sources in guile?
<dsmith>Probably fibers: https://github.com/wingo/fibers
<dsmith>Or good old select
<dsmith>s/good old/ancient/
<graywolf>I really need to learn how to do poll() in guile. I know there is (ice-9 poll), but it is not even mentioned in the manual :/
<dsmith>Hah. had no idea there was a poll interface. No docs. No tests either!
<mwette>di
<jason>I'm trying to use `guix pack -S /bin=bin -RR guile-next artanis guile-srfi-197 ...` to a non-guix machine. I can `bin/guile` just fine but all of the modules are in `/gnu/store/...` and not on the guile load path so I can't use them. Does the guile load path accept wildcards? I'm under the impression it doesn't. Is there a more idiomatic way I should be doing this?
<graywolf>I guess you could use wrap-command to produce an entrypoint binary that would set the path
<graywolf>Not sure if there is a better way
<jason>I do have a good spot to just go through the entire store directory, just seems unintended
<jason>another things I'm interested in is getting a minimal distribution. Is there any way to compile a module AND all of it's dependencies into the same file and just use that? I'm under the impression you can only compile 1:1 scm:go which is fine for my source files but a pain for getting the compiled dependencies together
<graywolf>I wonder whether you could just make an amalgamation the way C project do. There is no restriction for just one (define-module) per file afaik.
<graywolf>I am not aware of anything built-in though.
<jason>wow yeah that is interesting and seems doable
<ttz>Does anyone know how does match fare performance-wise ? I was writing a tree algorithm and I like pattern matching on my nodes, however I have no idea how much performances I am sacrificing.
<dthompson>it generates the optimal code whenever I've checked
<ttz>great thanks
<ttz>Also, is there a way to match the value of a variable in scope? I may have missed something but I couldn't find the syntax.
<dthompson>(match var ...) ???
<ttz>using (ice-9 match)
<ttz>rather matching the value of k in (let ((k ...)) (match node (($ *node* k v) v) ...))
<dthompson>no that would rebind k to field 0 of node
<dthompson>what does "match the value" mean here? eq? eqv? equal? something else?
<ttz>it would be =
<dthompson>you'd need to use a predicate matcher
<dthompson>the ? syntax
<graywolf>(? (cut = k <>) v)
<graywolf>I guess?
<ttz>Is a closure created there or is it pure syntax transformation?
<graywolf>Closure. But since ? expects a predicate, you need *some* procedure to put in there
<ttz>Can it be inlined by the compiler?
<dthompson>unlikely it would be compiled as a closure
<dthompson>but if you're optimizing to this degree, check bytecode disassembly
<dthompson>reason it's likely not a closure is that it's a small procedure used in exactly one place
<ttz>that's what I would have guessed too but I don't know how well Guile optimizes this kind of things
<ttz>I guess you're right, I will try having a look at the disassembly
<dthompson>guile has a compiler pass for this
<ttz>but I am really not familiar with any kind of assembly so it is rather cryptic to me, I was looking here for a short-cut ahah
<dthompson>see https://wingolog.org/archives/2016/02/08/a-lambda-is-not-necessarily-a-closure
<ttz>oh I didn't see this one thanks a lot
<graywolf>thx for the link, based on the title sounds interesting :)
<dthompson>yw
<sneek>dsmith: wb!