IRC channel logs

2018-04-08.log

back to list of logs

***galex-713_ is now known as galex-713
<gour>hello
<gour>i'd like to learn some guile/scheme in order to be able to tweak/customize/write Gnucash reports. someone suggested me to go through the first chapters of SICP, HTDP and TLS books. do you have any other recommendation. i have a copy of Realm of Racket, but that's probably too different...and didn't have much time to play with it
<gour>ACTION is reading 2.2-manual
<fibration>gour: http://ds26gte.github.io/tyscheme/index-Z-H-1.html#node_toc_start
<gour>fibration: thanks a lot, it looks great!
<fibration>scheme implementation vary a bit but this should be a good start. the time you stumble upon something that's different in Guile you are probably advanced enough to solve that problem yourself.
<gour>good
<fibration>And if you are an Emacs user install the geiser package.
<gour>yes, i use emacs
<cmhobbs>ACTION installs guile for the first time in ~6 months
<daviid>cmhobbs: greta!
<daviid>great!
<cmhobbs>daviid: it's your fault, you know...
<daviid>yep! I assume ... :)
<cmhobbs>no idea what i'm going to hack on at the moment
<daviid>welcome back cmhobbs!
<cmhobbs>but i'll find some sort of little pet project to write to get my toes back in the water
<daviid>as spk121 said recently, pick some that pleases you ...
<cmhobbs>resubscription to guile-users was the finalnail in the coffin
<cmhobbs>gotta get oriented again
<cmhobbs>i'm sure it'll be like riding a bike once i get geiser set up
<daviid>cmhobbs: yes
<cmhobbs>since that ssh library is a thing, i might see about whipping up a script to update my mdns record on a remote system with some regularity
<daviid>cool
<cmhobbs>just something small in scope to get it back in my brain
<daviid>trying some using guile-ssh is an excellent idea
<cmhobbs>i like how package-install geiser tells me it can't find geiser but package-list-packages shows (and installs) geiser...
<cmhobbs>thanks, emacs
<cmhobbs>i may need to update my packages, emacs tells me it's an available obsolete package
<daviid>cmhobbs: not sure, I install geiser from the source
<cmhobbs>yeah, i'm having all sorts of trouble with melpa right now
<cmhobbs>man, my .emacs is a total mess. one of these days i need to clean i tou
<cmhobbs>it out*
<cmhobbs>i also don't understand why people love paredit so much
<cmhobbs>it drives me nuts
<cmhobbs>the emacs wiki has a line on par edit just for me, though: " Its behavior can be jarring for those who may want transient periods of unbalanced parentheses, such as when typing parentheses directly or commenting out code line by line."
<cmhobbs>well, i'm going to have some work to do...
<cmhobbs>$ guile
<cmhobbs>guile: error while loading shared libraries: libguile-2.2.so.1: cannot open shared object file: No such file or directory
<cmhobbs>y
<cmhobbs>that's after installing guile 2.2.3 from source
<daviid>hum, not sure, is the lib path in ldconfig? worth verify, add if necessary and re run ldconfig as root
<cmhobbs>oh boy
<cmhobbs>$ sudo ldconfig
<cmhobbs>ldconfig: /usr/local/lib/libguile-2.2.so.1.3.0-gdb.scm is not an ELF file - it has the wrong magic bytes at the start.
<daviid>cmhobbs: you can ignore that
<daviid>try guile again
<cmhobbs>seems to be working
<cmhobbs>scheme@(guile-user)>
<daviid>perfect!
<cmhobbs>i've got a repl in emacs now, as well
<daviid>cmhobbs: geiser rocks!
<cmhobbs>yeah, i just gotta quick copying and pasting like a caveman and get the keybindings in muscle memory
<daviid>cmhobbs: and if you grow your pet project, use git, try magit as well
<daviid>cmhobbs: i almost never copy/paste, C-x C-e ...
<cmhobbs>i use magit heavily
<daviid>but anyway, everyone has its habbits
<cmhobbs>at work
<cmhobbs>the only issue i have with it is doing interactive rebasing
<cmhobbs>it's much easier to do that via the shell
<cmhobbs>than it is to do in emacs proper
<daviid>I'm a pathetic emacs user :), and do not use any paredit tool, never got use to those ... :)
<cmhobbs>yeah, emacs is my editor of choice these days
<cmhobbs>i used vi(m) for about 15+ years
<cmhobbs>had a project with sbcl and found vim-slime to be lacking
<cmhobbs>so i just jumped into emacs cold turkey
<cmhobbs>org-mode kept me there
<cmhobbs>guile-ssh's INSTALL and README files speak of a configure script but it doesn't come with one
<cmhobbs>i'll probably tinker with a different project for now instead
<cmhobbs>what libraries are available for making http requests and parsing html?
<daviid>cmhobbs: run autogen.sh or bootstrap
<daviid>keep trying guile-ssh, it is super wel developed and maintined
<cmhobbs>daviid: ah right. big oversight on my part
<daviid>source tree never come with configure (keep tht in mind...)
<cmhobbs>no autogen or bootstrap supplied. that comes with build-essential in apt, no?
<daviid>let me check
<cmhobbs>no, doesn't appear to
<daviid>ok, then run autoreconf -vif
<daviid>cmhobbs: that willd o
<daviid>did it?
<cmhobbs>seems to have worked, yes
<cmhobbs>thanks
<cmhobbs>i knew source trees didn't come with configure, it just slipped my mind
<cmhobbs>anyhow, do you know what libraries are available for making http requests and for parsing html?
<cmhobbs>i think i'm going to scrape a table
<daviid>cmhobbs: guile core has http request, parsing html is done using html->sxml ... and we have htmlprag in guile-lib as well
<cmhobbs>rather, json parsing might be best
<daviid>ah, then guile-json
<cmhobbs>thanks
<mwette``> cmhobbs: guile-lib (on savannah) has `htmlprag.scm' which will parse html
<daviid>cmhobbs: http://github.com/aconchillo/guile-json
<cmhobbs>i'll have to update it but it appears as if i have guile-json installed already
<cmhobbs>will web http handle https?
<rekado>cmhobbs: Guile 2.2.2 had a bug with HTTPS, but it’s fine with 2.2.3. You need Gnutls for this.
<cmhobbs>hm, ok
<cmhobbs>i guess i'll sift the documentation
<cmhobbs>querying a restful api and doing useful stuff with its output may be a decent project for now
<cmhobbs>well, this is lame
<cmhobbs>Throw to key `gnutls-not-available' with args `("(gnutls) module not available")'.
<cmhobbs>i've installed gnutls via apt, rebuilt guile 2.2.3, and ran ldconfig
<cmhobbs>no luck
<cmhobbs>looking at building gnutls from scratch for this
<cmhobbs>s/scratch/source
<daviid>cmhobbs: installing guile-gnutls on debian is ... next to impossible, for those of us using guile from source. the only way I succeeded is by grabbing thelatset gnutls stable and manually recompile install in /opt (not to conflict with the debian package ...)
<cmhobbs>i just built gnutls from source
<cmhobbs>alright, i appear to be getting data back from (http-get (string->uri "https://mysupersecretapi.example"))
<cmhobbs>now to figure out how to parse it
<cmhobbs>and return useful info from it
<daviid>i think you have to pass an option so it builds guile-gnutls as well, not sure
<cmhobbs>nah, that was not necessary apparently
<daviid>ok
<cmhobbs>i'm not entirely sure what data type http-get returns, nor how send the response body to guile-json
<cmhobbs>i've got a great deal of reading to do i think
<cmhobbs>i think i've done this with ice-9 receive before
<cmhobbs>and indentation is way off in my scheme mode, wtf
<daviid>cmhobbs: guile's procedure index is your friend
<cmhobbs>yeah, i've already got it open
<cmhobbs>pardon the spam, i'm mostly rubber ducking here
<cmhobbs>scheme@(guile-user)> (use-modules (ice9 receive))
<cmhobbs>While compiling expression:
<cmhobbs>no code for module (ice9 receive)
<cmhobbs>is ice-9 not included with guile?
<cmhobbs>or do i need to download that separately
<cmhobbs>i'm pretty sure i've used receive in the past
<daviid>ice-9
<cmhobbs>wow, i'm dumb
<daviid>relax, you'll get it all back in a short ...
<cmhobbs>yeah, i keep having moments where code is flowing freely and then i hit a brick wall because i can't remember how to do some arbitrary thing