IRC channel logs

2022-03-28.log

back to list of logs

<apteryx>what's the most efficient way to read a compressed file using guile-zstd or guile-zlib and write the decompressed data to a 2nd file?
<apteryx>currently I had: (call-with-input-file "/tmp/chromium-98.0.4758.102.tar.zst" (lambda (port) (call-with-zstd-input-port port (lambda (port) (call-with-output-file "/tmp/chromium-98.0.4758.102-zstd-decompressed.tar" (lambda (p) (format p (get-string-all port))))))))
<apteryx>I'm trying to benchmark guile-zstd vs guile-zlib
<apteryx>I guess I should use a binary port
<apteryx>perhaps something like this: https://paste.debian.net/1235805/
<sneek>tohoyn: Greetings :D
<tohoyn>daviid: procedure gtk-widget-class-path doesn't work. see https://paste.debian.net/1235817/
<tohoyn>daviid: even though gtk-widget-class-path is deprecated this may be some internal error in G-Golf
<tohoyn>daviid: as the procedure is deprecated it probably does not make sense to make an overridden version of it
<tohoyn>sneek: later tell daviid I posted some messages about G-Golf and gtk-widget-class-path
<sneek>Got it.
<wingo>moin
<civodul>o/
<civodul>not sure how to combine to events in Fibers, like: wait until fd is available for read *or* some timeout has expired
<civodul>s/to events/two events/
<civodul>i can suspend and do both schedule-task-when-fd-readable + schedule-task-at-time
<civodul>but that's not the same semantics
<civodul>(expiry would happen even if the fd became readable in the meantime, etc.)
<civodul>and since there's no "operation" corresponding to "wait for fd", you can't just combine them the usual way
<tohoyn>daviid: passing an event to gdk-event-get-event-type does not work. see https://paste.debian.net/1235852/
<ArneBab>wingo: since Guile uses type-constraints during optimization already, would it be possible to expose that for warnings like the existing “called with wrong number of parameters”?
<ArneBab>wingo: this throws a nice warning: (define (a b) b)(define (c)(a))
<wingo>ArneBab: that should exist, see -Warity iirc
<ArneBab>yes, that exists and is very useful
<ArneBab>(it saved me a few times already)
<ArneBab>What I mean is this: (define (c a) (when (number? a) (string-append "Hello " a)))
<ArneBab>The call to string-append is guaranteed to fail.
<ArneBab>Would it be possible to catch that at compile-time?
<ArneBab>When I call it, I get for example (c 5) ⇒ In procedure string-append: Wrong type (expecting string): 5
<ArneBab>wingo: (sorry for the long intro — wanted to give the context of what already exists but hadn’t yet reached the actual question …)
<wingo>ah that
<wingo>humm, it's certainly possible
<wingo>the issue is that right now warnings are on the tree-il level but the flow analysis to recover types is on the cps level. also the type info is more expensive to compute
<wingo>to my mind a language layer like typed racket is more appropriate
<ArneBab>That’s something I also thought about, but typed racket has a performance penalty: https://github.com/michaelballantyne/typed-racket-performance
<ArneBab>or at least had it
<ArneBab>this says that typing can improve performance: https://docs.racket-lang.org/ts-guide/optimization.html
<ArneBab>(and is more recent)
<ArneBab>wingo: Could we create something like typed racket in a way that improves performance in Guile programs?
<wingo>well... the issue isn't typed racket performance. it's composition of typed and untyped modules, and specifically the overhead of contracts. if your whole program is typed, typed racket is a win
<dsmith-work>Hey Hi Howdy, Guilers
<d4ryus>civodul: There is a pull request that implements "wait until port is x" operations: https://github.com/wingo/fibers/pull/50
<civodul>d4ryus: oh nice, thanks!
<civodul>otherwise it can be achieved with one fiber that sleeps, a second one that calls peek-char, with both sending an updated to a common channel and the main fiber reading from that channel
<civodul>if you see what i mean :-)
***karlosz_ is now known as karlosz
<d4ryus>civodul: Uh yes, thats quite elegant :)
<ArneBab>Is there a good way to avoid (or minimize) that contract-overhead?
***karlosz_ is now known as karlosz
***karlosz_ is now known as karlosz