IRC channel logs

2023-03-30.log

back to list of logs

<sneek>Yey! dsmith is back :D
<dsmith>sneek, botsnack
<sneek>:)
<sneek>Welcome back dsmith!
<_graywolf>I would like to use guile to configure my program, but I am unsure how that is usually done. Should I just return an alist '((name . "foo"))? Provide specific functions (set-name "foo")? Something else?
<_graywolf>What is usual way this is done? Ideally with links to programs that implement some of these strategies so that I can learn from them :)
<Arsen>that very much depends on what your program does
<Arsen>it might be logical for you to implement a part of your program in scheme, and then provide native code to extend that, a la emacs, or you might want to just provide a few functions and a way to invoke guile from your program, a la GNU make, or you might want to provide variables and tunables and hooks that are configurable via scheme instead of configuration files, ...
<_graywolf>Well the whole program is in guile, and I want to use it for config as well since the program will require user to set various hooks and callbacks to operate.
<_graywolf>However I'm unsure if it's better to set the hook emacs' style (set! ...) or return some "configuration object".
<_graywolf>Unsure what will feel more natural
<flatwhatson>_graywolf: parameters can be a good choice for holding user-configurable values: https://www.gnu.org/software/guile/manual/html_node/Parameters.html
<_graywolf>flatwhatson: will check, thank you :)
<cow_2001>just for your general information, there is this - a minor mode that makes your split buffer show consecutive parts of the same buffer side by side! https://www.gnu.org/software/emacs/manual/html_node/emacs/Follow-Mode.html
<cow_2001>you know what would be nice? in the guile prompt, if you write a procedure outside of parentheses, it'll show ,describe by default
<lloda>you can use ,d instead of ,describe
<pinoaffe>cow_2001: you can use https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile_0027s-repl_002dprint-procedure.html to change how it prints procedures
<old>cow_2001: that would not be so nice. procedure are value and the REPL print thtat value
<pinoaffe>old: I mean, you can pretty much make the REPL print values in whatever way you like
<pinoaffe>as long as the meaning of what is printed is clear to all users of the REPL, it shouldn't matter too much
<old>pinoaffe: Sure!
<old>As lons as the default is a good one
<pinoaffe>yeah, I sure wouldn't want that in my REPL :)
<old>I don't mind if someone put a define-method <procedure> in their .guile!
<cow_2001>huh!
<cow_2001>how do you run those repl commands from guile?
<old>object-documentation
<cow_2001>info guile object-documentation doesn't show up
<cow_2001>wait, i've got the internet!
<old>(ice-9 documentation)
<cow_2001>thank you!
<old> https://paste.sr.ht/~old/2876a470798a72fd4b9a9b08218a5b73c4292d30
<old>put this in your ~/.guile
<old>and start a new REPL
<old>try it with just '+' to see it
<cow_2001>now it's (write obj) (newline) (write (object-documentation obj)) (newline)
<cow_2001>we'll see how much i like it
<cow_2001>maybe i should put the (write (object-doc...)) inside an (when (procedure? obj) ...)
<cow_2001>thank you!
<cow_2001>wait, why and=>?
<cow_2001>ACTION looks it up in the info file
<cow_2001>ah, it'll blow up if there is no documentation
<cow_2001>(define (f) '()) f blows up
<cow_2001>so does just `1`
<cow_2001>old: this is great! thank you!
<cow_2001>now we can start a betting pool for when i find it annoying
<old>you could wrap it inside a when procedure? sure
<old>but documentation is generic to any type. It's actually an object-property
<old>so any predicate is valid as long as their a documentation property attched to the object
<old>I already find it anoying. I don't need the documentation of '+' or '-' ^^
<old>this is why I find that the good default is to not show the doc, then you explicitely ask for it with ,describe
<old>but your dot-guile is your dot-guile!
<cow_2001>do you end up deleting all buffers every now and then in emacs just so you can open just the stuff you need?
<cow_2001>okay, something I don't get: (define foo '()) (define (change! some-list) (set! some-list (cons 1 some-list))) (change! some-list) foo is still '(). is there a way of changing the value of foo without referring to it directly?
<gnucode>hey guile people! I made a guile script last night to automount my usb stick on OpenBSD via hotplugd. That was fun!
<lloda>cow_2001: no.
<lloda>scheme variables are names, not places
<lloda>you can use boxes or something like that if you need the feature
<cow_2001>srfi-111
<gnucode>hey guile people! I am trying to install haunt on OpenBSD. I need to install guile-commonmark first.
<gnucode>so I have guile3.0 installed in OpenBSD. the binary is guile3.0 , which is a weird name.
<gnucode>the guile commonmark is failing because it is trying to find the guile binary.
<gnucode>is there a way to tell the configure script that the guile binary is called guile3.0?
<Arsen>which configure script? commonmark?
<gnucode>Yes. Guile commonmark's configure script cannot find the guile binary, because the binary is called guile3.0
<Arsen>try specifying GUILE=guile3.0
<Arsen>(as an argument)
<gnucode>ok. thanks.
<gnucode>./configure GUILE=guile3.0
<gnucode>No Guile development packages were found.
<Arsen>do you have pkg-config or pkgconf? mind posting the config.log?
<Arsen>the latter should reveal exactly what it tried and why it failed
<gnucode>sure. just a sec
<gnucode> https://paste.debian.net/1275792/
<Arsen>seems that the version you have doesn't even try 3.0
<gnucode>seems like it.
<Arsen>try a fresh master off of the uptsream repo
<Arsen>the latest release doesn't list 3.0, but the development branch does
<gnucode>ok. just a second.
<gnucode>now I need to install autotools.
<gnucode>autoreconf specicaly
<gnucode>./bootstrap
<gnucode>Provide an AUTOCONF_VERSION environment variable, please
<Arsen>you'll need automake and autoconf
<gnucode>export AUTOCONF_VERSION=2.71
<gnucode>ok let me download those too.
<gnucode>./bootstrap
<gnucode> https://paste.debian.net/1275795/
<gnucode>aclocal failed apparently.
<Arsen>aclocal should be part of automake
<gnucode>ahh. I didn't install automake yet...
<gnucode>no nevermind I did install automake
<Arsen>well, you could try running aclocal manually
<gnucode>aclocal
<gnucode>"/usr/local/bin/aclocal[34]: /usr/local/bin/aclocal-1.16.5: not found"
<Arsen>hmm
<Arsen>what did your automake 'make install' install?
<gnucode>but `which aclocal` -> /usr/local/bin/aclocal
<Arsen>seems like a wrapper
<Arsen>ls /usr/local/bin/aclocal*
<gnucode>ls /usr/local/bin/aclocal -> /usr/local/bin/aclocal*
<Arsen>are there any other files starting with aclocal in there, that's what I'm wondering
<Arsen>alternatively, I can build you a dist tarball, if you want
<gnucode>if you don't mind. that would be awesome!
<gnucode>are there any other files starting with aclocal in there, that's what I'm wondering -> how would I check that?
<gnucode>Arsen: in /usr/local/bin I have "aclocal" and I have "aclocal-1.16"
<Arsen>well, just `ls /usr/local/bin/aclocal*'
<Arsen>try calling aclocal-1.16 directly
<gnucode>aclocal-1.16 seems to have ran without issue.
<Arsen>neat, try autoreconf -i now (without the -f)
<gnucode>ok typing in "autoreconf -i"
<gnucode>that failed. but I also have 3 autoreconf binaries in /usr/local/bin.
<Arsen>heh.
<Arsen>try the -1.16 one
<gnucode>so let me try the latest one "autoreconf-2.71 -i"
<Arsen>oh, right
<Arsen>that's in autoconf, so that's 2.71
<gnucode>"/usr/local/bin/aclocal[34]: /usr/local/bin/aclocal-1.16.5: not found"
<Arsen>tsk
<Arsen>try ACLOCAL=aclocal-1.16 ./bootstrap
<gnucode>ok. will do.
<gnucode>that worked right up until "/usr/local/bin/automake[34]: /usr/local/bin/automake-1.16.5: not found"
<gnucode>I have 2 automakes installed as well. :)
<Arsen>aha
<Arsen>try AUTOMAKE=automake-1.16 ACLOCAL=aclocal-1.16 ./bootstrap
<Arsen>(you see where this is going...)
<gnucode>Arsen yup. that seemed to work
<gnucode>hey hey I have a configure script now!
<Arsen>woo
<gnucode>configure worked!
<gnucode>make is working too.
<Arsen>woo
<Arsen>I got some test fails on my end fwiw
<Arsen>dunno what that's about
<gnucode>Arsen: what sort of test fails?
<Arsen>er, I closed the window
<Arsen>run make check - it might fail there too
<gnucode>Arsen yes I did get 3 failures.
<gnucode>that's interesting.
<Arsen>those then, probably ;P
<Arsen>dunno what those are
<gnucode>me either.
<gnucode>hmmm. when I type in guile3.0
<gnucode>(use-modules (commonmark sxml)) that worked.
<gnucode>well I suppose that I should report this as a bug to the main developer.
<gnucode>apparently even guix is getting test failures.
<gnucode>at least from 2021
<gnucode> https://github.com/OrangeShark/guile-commonmark/issues/20
<gnucode>Arsen: thanks for the help. I'm off to install haunt now.
<Arsen>np, happy hacking
<gnucode>Arsen: sweet. haunt is installed. now I get to build a new blog post.
<Arsen>neat
<gnucode>dthompson: hey I just installed haunt on openBSD! and it works!
<dthompson>sneek: later tell gnucode wow, neat! glad haunt works on openbsd. thanks for the report!
<sneek>Will do.