IRC channel logs

2019-10-20.log

back to list of logs

<bsima>why are things called 'ice-9'? what is the history of this?
<bandali> https://lists.gnu.org/archive/html/guile-devel/2010-07/msg00046.html comes up
<bsima>mm thanks, i didn't think to search guile mail lists
<bandali>cheers
<bsima>if i write a library in guile, does that mean i have to open source it under the gpl?
<spk121>bsima: no. You can release code written in Guile under any license you like. But if you write a library to put in Guile itself, you need to follow GUile's license
<bsima>ok thanks
<daviid>spk121: ah ok, do you have any idea when?
<daviid>spk121: oh, i see there is a guile package i msys2 already, that says it is 2.2.6-1 based o arch? here https://packages.msys2.org/base/guile
<daviid>str1ngs: closures are now working in g-golf - undocumented yet, but you find some 'useless' examples in the thest-suite, that will give you an idea on how to create and call closures ...
<daviid>str1ngs: this is the first step toward signals ... though not very usefull untill they are 'usable' (like in callbacks and signals), they are the 'corner stone of those', if you want to play/test a few ... feedback bugreport welcome ...
<daviid>janneke: tx, but i need either an msys2 package, or instructions to build guile i a msys2 environment
<daviid>chrislck: hello! wrt gnucash on w64, do you use msys2 as well?
<chrislck>daviid: my experience with guile in windows stems from hacking & using gnucash only... (and have dislodged a few gnucash&guile bugs) the msys2 installer takes care of packaging it I'm afraid
<janneke>daviid: ah, i don't know what an msys2 package looks like
<janneke>could be trivial to create from a guix pack, ie in the cross build, could be pretty hard :-)
***ng0_ is now known as ng0
***ng0_ is now known as ng0
***analogue_ is now known as analogue
<soda__hobart>hi everybody, hoping that the scheming might help the guiless, I'm tripping on something--how do I access the multiple values returned from the web client? I'm kicking myself because I figured this out last week, but now I don't remember how I did it.
<soda__hobart>this is what I tried: (define gnu-site (call-with-values (http-get "https://www.gnu.org" #:decode-body? #t) (lambda (response body) (list response body))))
<soda__hobart>but I get a "Wrong type to apply" error
<chrislck>(call-with-values(call-with-values (lambda () (http-get "http://192.168.20.1")) (lambda (response body) (list response body)))
<chrislck>(call-with-values (lambda () (http-get "http://192.168.20.1")) (lambda (response body) (list response body)))
***apteryx_ is now known as apteryx
<soda__hobart>so why does it do what I want when I wrap the (http-get) in a lambda? Doesn't (lambda () (http-get ...)) return the same thing as just plain (http-get...) ??
<chrislck>no, (http-get ...) returns something which is not a thunk; call-with-values wants a thunk
<soda__hobart>oh...!
<soda__hobart>cool, thanks, learned something today
<chrislck>you're welcome!
<soda__hobart>so is that like a generally used pattern, wrapping a procedure in a lambda to make it a thunk so it can be passed around more easily?
<chrislck>sure, do a full-text-search for thunk in the manual to find all of them
<soda__hobart>or I guess it's kind of like memoization, or a promise object? Looking at the wikipedia.
<chrislck>no: memoize means the thunk output isn't called every time; it's called once then the output is retreived from cache
<chrislck>promise means the thunk is not evaluated immediately but can be another time
<chrislck> https://wiki.call-cc.org/eggref/4/memoize
<soda__hobart>oh ok, so it's like in SICP where they talk about evaluation and applicative order and stuff
<soda__hobart>so like a practical use could be something like downloading a big ol' file--we can see if the response is positive, and then the http-get can keep evaluating while we do something else?
<chrislck>huh this is about multithreading/fibers. I think http-get will freeze while downloading?
<soda__hobart>I've been reading about fibers, but I'm more just trying to understand the concepts in general.
<soda__hobart>like I was playing with guile-redis, and made a pub-sub channel on redis, and I defined a procedure to listen to the channel that was like (define (listen my-channel) ((if (redis-send subscribe (my-channel) (display message) (listen my-channel)))))
<amz3>if you want to convert multiple values into a list of scheme object you use (call-with-values thunk (lambda args args))
<soda__hobart>roughly, like that, but I also used a named let to make it loop even if it does display a message
<soda__hobart>but it was using 100% of the CPU because it was just looping and burning rubber, so to speak.
<amz3>I am not sure about big files what happens
<amz3>soda__hobart: how is implemented redis-send?
<amz3>can you paste the code?
<soda__hobart>I will re-write it real quick, I wrote it in the REPL last week, just messing around, didn't save it
<soda__hobart>but guile-redis is just a really thin wrapper over redis-cli, it's not like python-redis where there's some sort of listener for the pub-sub
<amz3>you rely on guile-redis?
<soda__hobart>oh I did save it
<soda__hobart> https://bpaste.net/show/EAUCC
<soda__hobart>I don't rely on it, it's just fun to mess around with
<soda__hobart>like if I'm just experimenting in the REPL, I like to use it for data persistence
<amz3>data persistence and REDIS in the same sentence does sounds good (to me)
<amz3>well, first pub-sub in REDIS might not work like other request-reply commands
<soda__hobart>well, I don't really need it to be persistent, haha
<soda__hobart>yeah it works differently for sure. in the redis-cli if you use the subscribe command it will just block and print lines when it gets a message
*amz3 reading https://redis.io/topics/pubsub
<amz3>it seems to me that it might be a bug a guile-redis.
<amz3>soda__hobart: anyway, what are you trying to achieve, what is the big picture of your project?
<soda__hobart>the big picture is I'm trying to make some sort of BBS or chat room for sharing plain text
<soda__hobart>brb, got to take the girls to the mall, haha
<amz3>ok
<str1ngs>daviid: great thanks, will check this out ASAP.
<soda__hobart>so anyways, I run that sub-listen procedure (from here https://bpaste.net/show/EAUCC) and htop says that guile is using 105% CPU and the laptop fan is hissing... I'm guessing it's because the recursive function keeps re-initializing (or establishing or whatever the correct terminology is) the subscribe command about a zillion times per second. Is that right?
<amz3>soda__hobart: my recommendation is to create an issue on github against guile-redis
<str1ngs>daviid: one thing and I kinda mentioned it before. is gi-import does a bunch of console output. looking like this ;; GtkTreeView 15 signals. is this temporary debugging out?
<str1ngs>daviid: also I think this is a good example to play with? http://git.savannah.nongnu.org/cgit/g-golf.git/tree/test-suite/tests/hl-api.scm?h=devel#n123
<Josh_2>Hi, am following this tutorial https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html I am at 3.2 but when I compile I keep getting this error https://plaster.tymoon.eu/view/1523#1523
<Josh_2>wait
<Josh_2>maybe I fixed it
<Josh_2>well
<Josh_2>I don't know what I did but it works now xD
<Josh_2>Is there a tutorial calling c functions from guile? an ffi
<amz3>Josh_2: look at existing bindings for exemple : https://notabug.org/guile-sqlite3/guile-sqlite3/src/master/sqlite3.scm.in
<amz3>the ffi is straightforward
<amz3>Josh_2: here is a small tutorial https://hyper.dev/blog/gnu-guile-ffi.html
<amz3>Josh_2: but do not use dynamic-link* if you need to access a static varialbe in C
<Josh_2>I currently just have two functions I want to call
<amz3>read the manual
<Josh_2>I want to do an ioctl call in guile, this is possible right?
<Josh_2>Or would it be better to just created a dynamic library in C which does the ioctl calls I want and then just jimmy that into my guile program with ffi?
***karlosz_ is now known as karlosz
<Josh_2>well I managed to get my library to work in guile :) I'm happy about that