IRC channel logs

2020-01-18.log

back to list of logs

<dsmith>sneek: later tell dsmith-testing Something
<dsmith>sneek: later tell dsmith-testing Something
<sneek>Got it.
<dsmith>sneek: later tell dsmith-testing Something else
<sneek>Got it.
***dsmith is now known as dsmith-test
<dsmith-test>hej
<sneek>dsmith-test!, you have 2 messages!
<sneek>dsmith-test, dsmith says: Something
<sneek>dsmith-test, dsmith says: Something else
<dsmith-test>great!
***dsmith-test is now known as dsmith-work`
***dsmith-work` is now known as dsmith
<dsmith>wingo: I changed the for-each to a named let and it's working fine.
<akhetopnu>what is the recommended websocket library for guile? dthompson's guile-websocket?
<akhetopnu>also where can I get a library for base64? `guix search base64` doesn't yield any results for guile, is it hidden somewhere in the ice-9 or r_rs ?
<dsmith>akhetopnu: Did you ever get your guile working? (no clue about the websocket lib, sorry)
<akhetopnu>yes I managed to install it through guix, it's impossible to find a *working* solution for emacs to make it run guile with proper loading paths, so I just run `guile --listen` in the terminal and then connect to it from emacs........
<akhetopnu>incredibly frustrating, but I'm not aware of any better IDE for guile (or any scheme)
<dsmith>Especially if you are used to slime. (which I hear is quite awesome)
<akhetopnu>I switched to sly but yes, it's like you're programming on another level compared to other languages
<dsmith>Geiser is pretty good though. Been a while since I've used it (or scheme).
<akhetopnu>the introspection and live-coding capabilities are refreshing (if you can say that about something that's existed for decades :P )
<akhetopnu>do you use something else for scheme?
<akhetopnu>by something else I mean 'not geiser'
<dsmith>Yeah. All these other IDE's are really just playing catch-up.
<dsmith>$DAYJOB is C and Bash an Python mostly. Embedded bare metal and Linux drivers. And MQTT and stuff.
<str1ngs>akhetopnu: geiser kinda does this well
<str1ngs>akhetopnu: geiser even has geiser-connect-local which does exactly what you want
<akhetopnu>I think i'm using connect-to-geiser or something
<akhetopnu>so that might be it
<str1ngs>geiser-connect creates its own REPL IIRC. so geiser-connect-local is preferred to connect to an existing REPL
<dsmith>I'm currently working on the build system to make install images for this guy: https://www.element14.com/community/docs/DOC-91420/l/avnet-industrial-iot-gateway-powered-by-raspberry-pi
<akhetopnu>I dream of an 'IDE' that you install and it doesn't do anything, it would have a list of well namespaces commands that you could use to build your own 'user profile', save it to a simple file with a list of key=value pairs per line that you could simply copy onto another computer and it would just work. You start with a blank screen and once you type a new unrecognized keybinding the editor asks you what did you intend to do. All the
<akhetopnu>editors I'm aware of start off with a ton of assumptions about how you're supposed to use them.
<akhetopnu>dsmith: that's low level stuff, do you enjoy doing it or are you thinking or switching to something else perhaps
<akhetopnu>not implying anything, just genuinely curious
<dsmith>Oh, I've always enjoyed being close to the metal.
<dsmith>Yeah, even emacs assumes a lot of things, though you can bend it around anyway you want if needed.
<akhetopnu>I can't find a base64 conversion package for guile anywhere, am I missing something or do people really write their own base64 conversion functions in every application they use?
<str1ngs>akhetopnu: maybe in guile-gcrypt ?
<str1ngs>(gcrypt base64) IIRC
<str1ngs>akhetopnu: https://notabug.org/cwebber/guile-gcrypt/src/master/gcrypt/base64.scm encode and decode suffice?
<akhetopnu>yes, I see this library can do hashes and other stuff too, should be good
<akhetopnu>I installed it through guix but guile doesn't see it, I need to sort these loading paths out...
<str1ngs>if you manual set GUIL_LOAD_PATH use the format found in ~/.guix-profile/etc/profile. or you could clobber it
<str1ngs>also GUILE_LOAD_COMPILED_PATH is helpful as well.
<str1ngs>also after installing if guix say source ~/.guix-profile/etc/profile . basically you need to restart your shell
<str1ngs>s/say/says
<akhetopnu>I added the `GUIX_PROFILE="/home/akhetopnu/.guix-profile"` and `. "$GUIX_PROFILE/etc/profile"` to my .bashrc but I guix didn't install the package into that folder
<str1ngs>guix install guile-crypt did not use that profile?
<akhetopnu>it installed it into /gnu/store/c64fi1b6qy4apvc8nza3palfii13fb5i-guile-gcrypt-0.2.1
<str1ngs>guix package -l . does it list guile-gcrypt?
<akhetopnu>yes, all in `/gnu/store/...`
<str1ngs>install technically does not apply to guix. it is only used as a comfort to people used to traditional managers.
<str1ngs>guix install creates a profile of symlinks to the store
<str1ngs>thing of it as a modern GNU stow
<str1ngs>think*
<akhetopnu>im not familiar with GNU stow
<str1ngs>I made have just dated myself then :P
<akhetopnu>lol
<str1ngs>basically when you do guix install it creates link from the store to ~/.guix-profile/bin/* etc
<akhetopnu>but those are all executable files
<str1ngs>guix build actually do the installing to /gnu/store this is how guix is multi user and atomic at the same time.
<str1ngs>ls -l ~/.guix-profile/bin you will see they are all symlinks
<akhetopnu>only guile-tools is, th[02:31:08] <akhetopnu> it fired up guile repl
<str1ngs>then you did not use the file command
<akhetopnu>ah
<str1ngs>use stat instead if this is causing confusion
<akhetopnu>it says it's an ELF 64 bit LSB executable, dynamically linked etc
<str1ngs>that seems work
<str1ngs>wrong*
<str1ngs>stat ~/.guix-profile
<akhetopnu>it's a symlink to /var/guix/profiles/per-user/akhetopnu/guix-profile
<str1ngs>that is corrent
<str1ngs>now stat ~/.guix-profile/bin/guile ?
<akhetopnu>regular file
<str1ngs>and stat /var/guix/profiles/per-user/$USER/guix-profile
<akhetopnu>symbolic link
<str1ngs>~/.guix-profile/bin/guile should be a symlink. you did use stat and not file?
<akhetopnu>I used stat
<akhetopnu>and it says 'regular file'
<str1ngs>I don't get that at all
<akhetopnu>I feel like I should remove it all and reinstall guix + guile, because the whole installation process isn't obvious to me and I was trying to make the loading paths work while installing, removing and reinstalling stuff over and over
<str1ngs>installing and removing with guix should not have adverse effects. it's multi user and atomic
<akhetopnu>if I installed guile through guix, should guile automatically see all consecutive packages installed through guix?
<str1ngs>are you on foreign distro? I'm assuming you are?
<akhetopnu>i'm on void linux
<str1ngs>yes, but it might require you to restart bash
<str1ngs>so given this guix install guile-grypt . guix package -i | grep gcyrpt should list guile-gcrypt
<akhetopnu>I did, and guile cannot find code for module (gcrypt base64)
<akhetopnu>hmm
<str1ngs>okay, but if you manually set GUILE_LOAD_PATH you can clobber guix's load paths
<akhetopnu>my GUILE_LOAD_PATH is set to /home/akhetopnu/.guix-profile/share/guile/site/3.0:/home/akhetopnu/.guix-profile/share/guile/site/3.0
<str1ngs>if you do need to set them. use the format that ~/.guix-profile/etc/profile uses.
<str1ngs>yes but flatten guile-gcrypts file list and I bet you the site is 2.2 :P
<akhetopnu>it is
<str1ngs>try with find $(guix build guile-gcrypt)
<akhetopnu>so guile 3.0 won't see it
<str1ngs>right you are on the bleeding edge and probably using the latest and greatest guix pull ?
<akhetopnu>yes
<akhetopnu>from guix pull straight into my veins
<str1ngs>mainlining guix and guile o.O
<akhetopnu>the find $(guix build guile-gcrypt) listed probably all the files in all subfolders in my home folder
<str1ngs>no it list guile-gcypts files only
<akhetopnu>can't be because I'm seeing some node_modules and .js files
<str1ngs>akhetopnu: let me guix pull I think we can fix this by using guile 2 only in the profile meantime
<str1ngs>first do guix build guile-gcrypt
<str1ngs>does it error
<str1ngs>that sub bash command is bittle sorry not the best command at time
<akhetopnu>ah, i need the daemon for it
<str1ngs>umm that that's implied haha
<akhetopnu>ok now it listed some guile files 2.2
<akhetopnu>so I should probably stick to the 2.2 version for now
<str1ngs>okay let me guix pull see if there is an easy way to resolve tis
<str1ngs>its api compatible not binary compatible
<akhetopnu>i see
<str1ngs>meaning you need to rebuild for 3.0
<akhetopnu>the guile-fibers installation is taking its time huh... I wonder why it's taking so long, it's just 1 library
<akhetopnu>I don't understand how am I supposed to run `guile --listen`, should I create a fifo pipe and pass it as the argument to --listen? I try `--listen=guile.sock` and it's showing me the help message
<akhetopnu>if I run `guile --listen guile.sock` it tries to compile the guile.sock file
<akhetopnu>it says 'listen on a local port or a path for REPL clients`
<akhetopnu>I can run `guile --listen` and it will listen on some default port on localhost. So when I connect to it with emacs a strange thing happens. When I type `(use-modules (gcr` it company mode doesn't autocomplete it, but if I finish typing it and C-c C-c it will load and then I can use the base64-* functions
<str1ngs>akhetopnu: does gule --listen=$PWD/guile.socket work?
<str1ngs>guile*
<akhetopnu>permission denied
<akhetopnu>i feel like I shouldn't need to run it as a superuser
<str1ngs>no lol
<str1ngs>see if the file exists already
<akhetopnu>ah, sec
<str1ngs>you need to clean up your socket when you are done with it
<akhetopnu>yes, it works, I was in another directory <facepalm>
<akhetopnu>however it doesn't autocomplete gcrypt for some reason
<str1ngs>maybe it only handles absolute paths. not relative paths. try with --listen=./guile.socket vs --listen=$PWD/guile.socket
<akhetopnu>in emacs, I mean
<str1ngs>probably because emacs is using an order GUILE_LOAD_PATH
<akhetopnu>I get autocompletion for ice-9 and all that though
<str1ngs>assuming you are using GUI EMacs
<akhetopnu>yes
<str1ngs>you probably need to relog your X11 session
<str1ngs>or.. use emacs-guix and load the environment :P pro trick
<str1ngs>akhetopnu: .. use emacs-guix and load the environment :P pro trick
<akhetopnu>there is no such package available
<akhetopnu>also after rebooting emacs still doesn't autocomplete it
<akhetopnu>it must be residing in some unexpected folder
<akhetopnu>weird, because my GUILE_LOAD_PATH is .guix-profile/share/guile/site/2.2 and `find . -name gcrypt` found 2 paths with this name
<akhetopnu>one of them being the GUILE_LOAD_PATH
<str1ngs>and in emacs (getenv "GUILE_LOAD_PATH") ?
<akhetopnu>nil, lovely
<str1ngs>did you install emacs with guix?
<akhetopnu>no
<akhetopnu>...should I?
<str1ngs>don't have to . the main thing is you need provdie X11 with variables
<str1ngs>or emacs
<akhetopnu>i started emacs from terminal and now it shows proper GUILE_LOAD_PATH but it still cannot autocomplete use-modules with gcrypt
<str1ngs>I would not worry about that completion. what about once you use the package?
<str1ngs>completion whould work then
<akhetopnu>the functions are available to use
<str1ngs>(use-modules (gcrypt base64)) does not complete for me. but the bindings do once it's used
<str1ngs>think that pretty normal
<akhetopnu>weird. I jumped to the source of (ice-9 futures) and it's inside some /gnu/store/...-guile-2.2.6-1/share/guile/2.2/ folder. There is also a `web` folder but I cannot get autocompletion for it
<akhetopnu>at least it works once loaded
<str1ngs>akhetopnu: I think that gets you setup based on your workflow?
<akhetopnu>more or less, but I'm sure something will get borked soon enough
<akhetopnu>knowing myself
<akhetopnu>thanks for help, it would've taken me much longer otherwise
<spk121>daviid: guile-gi doesn't require libgtk-3-dev except for its examples and test suite. But depending on your distro gobject-introspection may have a package dependency with libgtk-3-dev
***ng0_ is now known as ng0
<zig>hello #guile :)
***janneke_ is now known as janneke
***ng0_ is now known as n0
<chrislck>a bit annoying how emacs indents call-with-values...
***n0 is now known as ng0_
***ng0_ is now known as ng0
<mwette> chrislck: add (put 'call-with-values 'scheme-indent-function 0) in your *scratch* buffer and hit C-x C-e; if you don't like that change 0 to something you like
<akhetopnu>could've ended the sentence at 'emacs' /s
<mwette>change 0 meaning 1 or 2
<chrislck>thanks... makes you wonder what they're trying to promote/indicate with their indent
<chrislck>unless it's a genuine bug
<mwette>I've seen others with this type of indent behavior
***hugo is now known as root
***root is now known as hugo
<akhetopnu>I'm looking at (ice-9 match) and I'm not sure how would I go about matching a list of lists of certain shape and store it into a variable
<akhetopnu>I see I can match (pat_1 ... pat_n) but I have to actually know the number of elements
<akhetopnu>do I have to manually do an if-else type of check and manually type (let ((x <the list>)) ...) to do something with it?
<mwette>akhetopnu: maybe match on (head . tail) and loop with counter ?
<akhetopnu>yeah I can do the head and tail thing but I still have to do my own check on every element and then next a body of stuff to do with it
<akhetopnu>ideally I would do something like (match <s-expression> ((my-list ... (symbol _)) (display my-list))) and this would print the list of pairs of (symbol <whatever>) onto the screen, otherwise do nothing
<akhetopnu>it seems like a basic thing to do but I can't figure out if one of the patterns in guild manual fits this case
<akhetopnu>guile*
<mwette>you can match parts at the front and leave the rest to `. rest)'
<mwette>or write a custom matcher with syntax -- look at system/base/pmatch.scm
<akhetopnu>ok, let me put it this way
<akhetopnu>is it possible to match a list of numbers? any length
<akhetopnu>it's possible, via pattern (number ..1) (this matches 1+)
<akhetopnu>analogically (number ..2) matches 2+ numbers : D
<akhetopnu>I don't understand this match library... I can match a list of 2 numbers with (number ..2) but I can't say (list number number) or even (number number)
<mwette>check the `catamorphisms' subsection in the sxml-match section of the guile manual; there are some examples there
<daviid>str1ngs: so, none of the distro I am aware of offer to install libgdk-3 without libgtk-3
<daviid>str1ngs: and hence, it would be a complete loss of time to write somethng that checks if libgdk-3.so - in all distro i am aware of, this means the gtk+-3.0 is installed, and therefore, not can we, but must we call PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.24.0)
<daviid>spk121: no matter what, if a guile-gi user wants gdk event support, he/she must install gtk+-3.0, right?
<mwette>FYI, I ported bug to ubuntu against 18.04: they install guile as guile-2.2 and guile, but none of the other *-2.2 tools, only guild, etc; this hoses guile extension config scripts written w/ guile.m4 if you have a different version installed
<daviid>mwette: I think manual installation, running the make dance using a tarball, als fals to add the postfix to those scripts, I did mention that quite a lng time ago, never checked if this was solved
<zig>s-expr based regexp are very neat.
<daviid>str1ngs: to make it short, there is no way to only install libgdk-3
<daviid>hence I decide to get this PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.24.0) back in the configure.ac file of GGolf
<daviid>*g-golf
<akhetopnu>is there a way to destructure function arguments? example: (define (fn a b (c d)) ...) where you would call it like (fn 1 2 (list 3 4)) so c = 3 and d = 4?
<mwette>daviid: not sure what you are referring to: for my package nyacc I have added workarounds in my config scripts to deal with it. I let user provide GUILE= argument to configure
<daviid>str1ngs: fyi, libclutter-1.0-dev depends on it as well, because it needs Gdk Event support, not becaue it needs gtk support ... that's thw way the gnome team orginazed thing, there is nothing we can do about this
<daviid>mwette: ok
<daviid>str1ngs: i pushed the configure.ac fix
<daviid>now I shall work on other gdk events
<dsmith>Should (debug-enable 'debug) still work?
<zig>akhetopnu: look into define*
<zig>akhetopnu: or match
<zig>akhetopnu: btw if you don't know it yet, the procedure index is a very handy bookmark: https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html
<zig>akhetopnu: sorry, I did not read that you already know about match
<zig>akhetopnu: did you try the (a b c . rest) pattern to solve your problem?
<akhetopnu>I didn't, but by destructuring I mean something like javascript's `function asd(arg1, arg2, { key }) { <here I can use 'key' as variable that holds the keyname of the 3rd arg which is an object> }`
<akhetopnu>but I guess I can use match for that
<akhetopnu>There are lots of these 'SRFI-*' libraries, is there some sort of 'srfi index' website where I can browse the contents of all of these libraries? It would allow newbies like me to learn the APIs much faster
<akhetopnu>ah, the index you linked seems to list methods in those libraries
<lampilelo>the ones that are implemented in guile are in its info manual
<lampilelo>if you want to see more documentation you can look here: https://srfi.schemers.org/
<dsmith>sneek: seen unknown_lamer
<sneek>unknown_lamer was here Jan 16 at 03:34 pm UTC, saying: basically working is a start after ten years of gathering dust :).
<dsmith>unknown_lamer: I think I found the -D and -S options problem
<dsmith>unknown_lamer: guile 3 doesn't like "(debug-enable 'debug)" in Main.C
<daviid>lloda: one can 'simply' merge the wip-truncated-exception brach on master right?
<dsmith>unknown_lamer: One other thing I'd like to see. Get rid of the Mutex Init... Mutex: 0x1b67e14 Thread: 0xbfe8a46c
<dsmith>*** sneek_ (~sneek@cpe-65-185-85-154.neo.res.rr.com) has quit: Remote host
<dsmith> closed the connection
<dsmith>*** sneek (~sneek@cpe-65-185-85-154.neo.res.rr.com) has joined channel #guile
<dsmith> [14:1
<zig>akhetopnu: lookup define* and lambda* what you are looking for (it seems like) keyword argument. There is no way to destructure the equivalent of {a: b, c: d, ...} the way javascript does.
<zig>but you can use keyword arguments.
<jayspeer>hello, is this a good channel to ask general scheme question?
<dsmith>jayspeer: Sure, but you might want #scheme instead.
<jayspeer>I'll be sure to check it out :) thanks
<dsmith>But feel free to ask here
<jayspeer>so, I'm going through sicp and I'm stuck on 2.54
<jayspeer>I'm trying to define "equal?" function and I'm clueless why it doesn't work
<jayspeer>here is the code snippet
<jayspeer> https://paste.debian.net/1126566/
<jcowan>jayspeer: What does not work exactly?
<jayspeer>it fails on "car", though it should not get there in the first place
<jayspeer>if you test (my-equal? '(a) '(a)) it fails with "expecting pair" in procedure car
<jayspeer>oh, I think I know what's going on
<jayspeer>first condition fails cause nil is not a symbol, but I though it was
<jayspeer>then car can't get anything out of nil cause it is not a pair
<dsmith>You might want pair? instead of list?
<jayspeer>I tried pair? and then lists '(a) '(a) are not equal :) this will need further investigation from me :D
<jayspeer>I need to handle nil case better
<dsmith>In guile, (list? '()) => #t
<dsmith>
<dsmith>'() is nil for you I think.
<jayspeer>yeah I'm aware of that, thanks
<dsmith>And can't take the car of that..
<jayspeer>ok I got it. I switched first if condition to (or (symbol? a) (nil? a) ...) and it works as expected. I took longer than I'm willing to admit to finish this exercise :D
<jcowan>A style point: anything of the form (if p #t #f) can be reduced to just p
<jcowan>that would declutter you code quite a bit.
<jayspeer>jcowan: it sure did, thanks