IRC channel logs

2021-06-29.log

back to list of logs

***iskarian is now known as Guest427
<dsmith>RhodiumToad: How about non-continuable-error? ?
<RhodiumToad>dsmith: that doesn't do what you might think it does
<RhodiumToad>that tells you whether an exception object has a &non-continuable element in it
<RhodiumToad>but the lack of that doesn't mean it's continuable.
<dsmith>I was thinking that depends on how the exception was raised. If the continuable flag was set or not.
<dsmith>Up to the coder of the exception to get it right. Right?
<RhodiumToad>nope
<dsmith>That section of the manual is a bit light on examples.
<RhodiumToad>(with-exception-handler (lambda args (format #t "print2 ~S ~S\n" args (non-continuable-error? (car args))) 'continued) (lambda () (raise-exception (make-exception (make-error) (make-exception-with-message "foo!")) #:continuable? #t)))
<dsmith>Interesting..
<RhodiumToad>er, that's not quite what I actually meant
<RhodiumToad>better example:
<RhodiumToad>(with-exception-handler (lambda args (format #t "print2 ~S ~S\n" args (non-continuable-error? (car args))) 'continued) (lambda () (error "foo!")))
<RhodiumToad>that clearly isn't a continuable error, get non-continuable-error? still returns #f
<RhodiumToad>*yet
<dsmith>If you set #:continuable? to #t or #f, non-continuable-error? always is #f
<RhodiumToad>right, because non-continuable-error? is a property of the exception object, not of the way it was raised
<RhodiumToad>non-continuable-error? is true only for exceptions of type &non-continuable
<RhodiumToad>(which happens to be what gets raised if you try and continue after raising with #:continuable? #f)
<dsmith>I wonder if this is what was intended.
<dsmith>sneek: later tell wingo So what's up with #:continuable? ?
<sneek>Okay.
*daviid added a revealer.scm (g-golf) example (based on the revealer.c, from gtk-4-examples that comes with gtk-4) which demonstrate how to use <gtk-builder>, <gtk-revealer>, g-timeout-add and a detailed signal-name - the screenshot is 'static', but the 'real' example 'animates' 9 revealer instances, fun :)
<wingo>dsmith: honestly, not very fleshed out. such an exception needs to be raised via raise-continuable tho
<sneek>Welcome back wingo, you have 1 message!
<sneek>wingo, dsmith says: So what's up with #:continuable? ?
<wingo>or raise exn #:continuable? #t
<wingo>hey ppl, any idea why MysteriousSilver can't post to the channel?
<wingo>is the channel misconfigured or is there something MysteriousSilver should do?
*wingo irc idiot who happens to have op privs
<taylan>we're probably still registered users only?
*taylan gtg
<lloda>I did need to register before i could post
***chris2 is now known as Guest3021
<lloda>erc didn't tell me anything, my chat window looked as if the messages were getting through, but they weren't
***Guest3021 is now known as chrislck
<chrislck>Is there anyway to assign some guile code to be called when a SCM object gets gc'd?
<chrislck>(let ((my-object (newArray))) ...work on my-object...)
<chrislck>my-object will eventually be gc'd but the newArray is C code which allocates and must be freed.
<chrislck>I know ideally the code should be:
<chrislck>(let ((my-object (newArray))) ...work on my-object... (freeArray my-object))
<RhodiumToad>wingo: the channel is set to that unregistered users can join but not speak; if you want to change that, you can remove the -q $~a mode
<RhodiumToad>chrislck: you can use finalizers or guardians
<leoprikler>chrislck: there are finalizers, specifically pointer finalizers
<chrislck>thx both -- finalizers are very new to me. is there a one-liner that I can use?
<leoprikler>not so much a one-liner, but we've used them e.g. in guile-fontconfig (no release yet, but it worksâ„¢ for some tests)
<chrislck>ok will read when i have time :P
<RhodiumToad>is there a way to use finalizers from pure guile code (i.e. not using C)? I didn't find one on a quick search
<leoprikler> https://gitlab.com/leoprikler/guile-fontconfig/-/blob/master/fontconfig/char-set.scm#L30
<leoprikler>TL;DR: (system foreign-object) is your friend
<RhodiumToad>ah right
<sarna>hey, which architectures does guile support? is it only x86_64 and i386? I can't really find it on the main page
<wingo>jit support on arm64, armv7, i386, x86-64. without jit on pretty much everything else that you can compile linux on. not great windows support currently tho
<sarna>hey wingo, I just watched your talk! :D I was mostly wondering if I could run guile on my RPi, thanks!
*RhodiumToad has run guile on an rpi
<RhodiumToad>had to fix some bugs, but those fixes are all in recent versions
<sarna>neato
<RhodiumToad>I've only tried it on armv7 and not aarch64, though
<RhodiumToad>the rpis I have in use are older ones
<sarna>are the platforms listed anywhere? I can't find them in the reference manual either, wiki lists only two - https://en.wikipedia.org/wiki/GNU_Guile
<RhodiumToad>pretty sure all of the code outside the jit library itself is intended to be architecture-neutral
<MysteriousSilver>Hello!
<RhodiumToad>good afternoon or other relevant time of day
<MysteriousSilver>salute RhodiumToad
<MysteriousSilver>i previously had trouble sending messages to this channel
<RhodiumToad>the channel is currently set to only allow registered and identified nicks to talk
<RhodiumToad>(though anyone can join)
<RhodiumToad>it's to cut down on spam, though it may not be necessary
<MysteriousSilver>new to irc, took time to realize
<sarna>damn, I can't install guile on my RPi :( aarch64, debian
<RhodiumToad>huh, why not?
<sarna>complains about libc6 version (expects >= 2.29 but debian only has 2.28 it seems)
<RhodiumToad>what exactly complains?
<sarna>apt
<sarna>if I try `apt install guile-3.0` it complains that I don't have guile-3.0-libs, if I try `apt install guile-3.0 guile-3.0-libs` it tells me libc6 is too ancient
<RhodiumToad>ok, so that's just a package management problem
<RhodiumToad>and I don't use linux so probably not the best person to help
<chrislck>leoprikler: thx looks like it's the solution :)
<sarna>RhodiumToad: what do you use? BSD?
<RhodiumToad>freebsd, yes
<sarna>neat!
<RhodiumToad>(for which guile does need a couple of patches, mainly to do with bad assumptions about off_t)
<RhodiumToad>(thanks to *BSDs having never been infected by the ghodawful largefile hacks)
<chrislck>leoprikler: looks good. however my constructor doesn't need an argument, and am struggling to make it work.
<leoprikler>a constructor without an argument?
<leoprikler>do you have a fieldless record?
<chrislck>uhh
<chrislck>yes
<chrislck>something like (newArray)... it's populated via something like (InsertAt array 1 1) and finalized via (freeArray)
<dsmith>sarna: The bot here ran on an rpi for a while. Now it's on a beaglebone black.
<dsmith-work>Morning Greetings, Guilers
<tekakutli>hello dsmith
<rlb>sarna: wrt architectures, all the green ones here at least build and pass "make check": https://buildd.debian.org/status/package.php?p=guile%2d3%2e0
<rlb>and 2.2's doing a bit better: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid right now, though I suspect sometimes it has mattered which build host picks up the job...
<rlb>Oh, though I should perhaps mention that on some of the platforms some tests have been marked as "unreliable", and their failures ignored.
<sarna>dsmith-work: it's a pretty small board! my rpi is beefier, I got the new one
<sarna>rlb: thanks, that's a lot of archs 👀
<dsmith-work>sarna: Nice!
<leoprikler>chrislck: you should still have something like an array* that's returned by newArray and wrapped by your <array>
<civodul>roptat: no crash for me! https://gitlab.com/guile-git/guile-git/-/issues/19
<vijaymarupudi>hello all!
<sneek>Welcome back vijaymarupudi, you have 1 message!
<sneek>vijaymarupudi, leoprikler says: scm_gc_protect
<vijaymarupudi>ah yes, that's for storing it in the heap, I think I can live with the gc for the stack variables for now
<vijaymarupudi>I wanted to ask for any large guile project I can read the source code of and learn from!
<maximed>any particular reason bytevector=? doesn't accept offset & length arguments, or a bytevector-range=? doesn't exists, besides ‘that's not RnRS’?
<maximed>fwiw, I worked around this lack with bytevector->pointer & pointer->bytevector
<maximed>maybe something for (system foreign): (define (bytevector-range bv offset length) (pointer->bytevector ...))?
<maximed>I've seen the combination pointer->bytevector & bytevector->pointer a few times before (or was it the other way around?)
<sarna>vijaymarupudi: guix? :)
<vijaymarupudi>sarna: haha I was expecting that :) however I suspect that it's macro heavy, which might be a bit difficult for me to understand right now
<vijaymarupudi>Maybe medium sized rather than large
<lampilelo>vijaymarupudi: http://sph.mn/foreign/guile-software.html
<vijaymarupudi>lampilelo: that's perfect, thank you!
<maximed>except for the 'package' macro, Guix doesn't use macros all that much
<maximed>There are plenty of procedures in guix/lint.scm, for example
<maximed>lilypond hould be a good example of a guile project as well
<vijaymarupudi>that's good to know
<vijaymarupudi>thanks!
<maximed>And gexp (#~) is a macro as well. Actually, Guix uses plenty of macroology. But there's plenty of ‘procedurology’ as well.
<leoprikler>Don't forget about Guix' advanced record wizardry.
<leoprikler>plus anything having to do with monads :P
<vijaymarupudi>advanced record wizardry?
<leoprikler>(guix records) to name a start