IRC channel logs

2017-07-28.log

back to list of logs

<magnicida>hi!
<magnicida>I'm working on some library to make it easy to bind C++ code to Guile
<magnicida> https://sinusoid.es/schmutz
<magnicida> https://github.com/arximboldi/schmutz
***sajith is now known as Guest52073
<ArneBab_>magnicida: nice! (and a nice name ☺)
<magnicida>thanks! :-)
<solene>hello, what is the best way to describe a structure with attributes in guile scheme ? I'm currently using (list '(attr1 . "value1") '(attr2 . "value2")) and retrieve values with (cdr (assoc 'attr1 mylist)) but I'm not sure it's the best way to achieve this
<lloda>solene: in Guile there's assoc-ref
<lloda>if you're not sure, encapsulate so you can change the structure later w/o affecting users
<lloda>e.g. to a hash table later on
<solene>indeed, assoc-ref is easier than my code, thanks lloda
<solene>I miss getf and keywords from common lisp
<solene>is it right that I can't use keywords instead of pairs ? like #:attr1 "value1" instead of '(attr1 . "value1")
<mbuf>Does guile use pthreads?
<mbuf>can it be used for parallel and concurrent programming?
<solene>mbuf: AFAIK guile uses green threads so everything runs on one CPU but can share time between tasks
<solene>which is not what you want
<janneke>solene: you can use `((#:attr1 . ,v1) (#:attr2 . ,v2))
<lloda>solene: mbuf: Guile does use pthreads. See (ice-9 threads). It's not the most robust thing ever ime, but it's there.
<lloda>see also e.g. https://github.com/wingo/fibers
<mbuf>solene, lloda okay, thanks!
<mbuf>lloda, fibers is nice
<solene>janneke: that's the same as not using keyword ?
<janneke>solene: i don't understand...using keywords as keys is using keywords, not using keywords as keys is using ... well whatever you are using
<lloda>I think solene wants to (make-data #:key value #:other-key other-value ...)
<solene>janneke: I'm still in a common lisp way to think so I have bad habits from a schemer point of view, both languages are close and also very differents. I was writing this in common lisp and wondered if it was possible (list #:attr1 "value" #:attr2 "value")
<lloda>I guess you can build that taking a rest list and then using keyword->symbol
<lloda>it's not built in
<janneke>solene: ah...i'm not much of a lisper
<janneke>i think (ice-9 optargs) has something for handling (list #:attr1 "value" #:attr2 "value")
<solene>I'll see ice-9 and make-data, thanks janneke and lloda
<solene>but assoc-ref works so at least I got one way to do what I need ! :)
<mbuf>solene, what is the alternative to green-threads?
<solene>mbuf: I don't know, I'm not using guile since a long time and I've read this in a tool documentation relying on guile that only green threads were available. and lloda said that pthreads were available with ice-9
<mbuf>solene, okay
<lloda>solene: make-data doesn't exist, I was making it up. You can build it though
<lloda> https://www.gnu.org/software/guile/manual/html_node/Threads.html
***eagleflo_ is now known as eagleflo
***bgardner_ is now known as bgardner
<ArneBab>mbuf: to keep it simple, you can use par-map for parallel work. Here’s an example: https://bitbucket.org/ArneBab/freenet-guile/src/4faaf1c6bf88deff2914689f0f2b54ffda7d588c/crawl-wot.scm?at=default&fileviewer=file-view-default#crawl-wot.scm-201
<mbuf>ArneBab, I see
<ArneBab>via (import (ice-9 threads))) ; see (help par-map)
<ArneBab>it uses pthreads, though, which means you’ll want to have larger chunks of work. Essentially it gives you a thread pool.
<ArneBab>mbuf: fibers manage to give you both: easy threading and full usage of all your cores. So go for that if you can.
<mbuf>in GNU Artanis how is javascript added?
<mbuf>ArneBab, will give it a try; thanks!
<mbuf>ArneBab, is there anyone actively working on Emacs-Guile?
<ArneBab>this says that the last commit to elisp was a year ago: http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-elisp
<mbuf>ArneBab, okay
<ArneBab>this says the last commit to the emacs-part was in 2015: http://git.hcoop.net/git/bpt/emacs.git/info/
<ArneBab>which is what guix says, too: http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/emacs.scm#n258
<ArneBab> http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile.scm#n276
<ArneBab>ACTION wants to have a development team who uses Guix and Guile and Emacs and Wisp to build meaningful programs.
<mbuf>ArneBab, I am in!
<ArneBab>now we just need someone to give us money for that :)
<paroneayea>ACTION just sent "thanks for the reply" to the mailing list then felt awkward about it
<rekado>I have some Czech coins left after my trip to Prague. I’d use them to fund work on Guix/Guile/Emacs/Wisp.
<rekado>Now we only need to find people willing to match the donation.
<civodul>OrangeShark: could you add me to https://gitlab.com/guile-git/guile-git ?
<janneke>ArneBab: i'm working with a team that has adopted Guile and is adopting Guix...
<civodul>janneke: super cool!
<OrangeShark>civodul: sure
<janneke>civodul: yeah, took me > 3 years in the physical universe
<civodul>not so bad
<civodul>how much would it take in the virtual universe?
<civodul>s/much/long/
<janneke>not bad at all, with hindsight
<civodul>ACTION is also working on it :-)
<janneke>in the virtual universe, guile took 3 weeks, guix took only a week
<civodul>:-)
<civodul>OrangeShark: awesome! i have a few commits regarding settings and error handling
<OrangeShark>civodul: you should be added now
<janneke>it's so cool how guile and guix reinforce eachother
<OrangeShark>janneke: that is cool, how did you manage to pull that off? :)
<civodul>OrangeShark: thanks, and pushed :-)
<janneke>OrangeShark: by helping others solve an impossibl problem using Guile, then practice patience and much hard work
<OrangeShark>janneke: that sounds like a good way :)
<janneke>OrangeShark: :)
<janneke>ACTION tried much evangelism and finally gave up
<civodul>yeah it always works better when you solve practical issues
<paroneayea>janneke: awesome to hear :)
<janneke>civodul: i'm learning...
<janneke>civodul: Guile solved Rutger's problem -- that's almost 3 years ago
<civodul>heh
<civodul>janneke: now we need Rutger to solve "our" problems :-)
<janneke>i'm sure they will :-)
<civodul>OrangeShark: BTW, i'd welcome feedback on https://gitlab.com/guile-git/guile-git/commit/b6b2760c2fd6dfaa5c0fedb43eeaff06166b3134
<paroneayea>since I don't have a good solution for suspending custom ports right now
<paroneayea>I'm going to keep working on the 8sync-on-top-of-fibers thing so I can use an independent thread as a workaround
<ArneBab>janneke: cool!
<civodul>paroneayea: sorry i didn't help with this!
<civodul>that's quite a lot to page in and my cache is kinda full ;-)
<ArneBab>I created a simple doctest system based on srfi-64: just write your tests in the docstring. Example usage: https://bitbucket.org/ArneBab/wisp/src/1ce02fce232f429fc1cbd29c666e36d34ec22d76/examples/doctests-test.scm Code: https://bitbucket.org/ArneBab/wisp/src/1ce02fce232f429fc1cbd29c666e36d34ec22d76/examples/doctests.scm
<ArneBab>(just fixed the last glitches)
<ArneBab>syntax: (test 'testname ...) with ... the forms from srfi-64.
<paroneayea>civodul: it's ok!
<ArneBab>avoiding (test-begin 'testname) and (test-end 'testname) makes for easier parsing.
<ArneBab>(they are added automatically using the 'testname)
<civodul>paroneayea: i'd like to play around with Fibers or 8sync "one of these days", so hopefully i'll get to these issues too
<paroneayea>civodul: :)
<ArneBab>usage in the repl: (import (examples doctests)) (define (one) "(test 'foo (test-equal 1 (one)))" 1) (doctests-testmod (current-module))
<ArneBab>ACTION marks one more point on his convenient-coding-wishlist
<rekado>I’m autoconf’iscating another in-house tool today and I wished I could use Guile instead of the autoconf/automake/m4 macros.
<stis>heya guilers!
<stis>Did some fun things with functional objects and the python object model. check out and discuss if interested at http://www.c-lambda.se/functional-python.html
<spk121>I did my own take on a logger kind of like glib's logger that can write to console or systemd's binary log. It has actually been pretty useful. I'll have to clean it up and make it standalone sometime. https://github.com/spk121/libguile-mlg/blob/master/mlg/logging.scm
<ArneBab>rekado: what’s missing for you in autoconf? (I think it’s pretty good that autotools keep their requirements tiny — you need something to build Guile while there is no Guile yet)
<rekado>it would already be helpful to be able to generate configure.ac and Makefile.am from Guile.
<rekado>I find the syntax arcane and it’s tedious and verbose to write custom checks.
<paroneayea>okay
<paroneayea>so the Parallel Concurrent ML paper is great
<paroneayea>and after swimming in this stuff for a while I'm finally getting it ;P
<paroneayea>wingo: ping
<paroneayea>wingo: to do the gc of waiters, I'm assuming we're going to have to add a mutex around it right... right?
<paroneayea>or maybe it's possible if I do the spin thing
<paroneayea>maybe I could implement stack-filter! using update! from stack.scm
<paroneayea>I'll try that...
<paroneayea>hm
<paroneayea>I'm imagining a scenario where fiber A keeps doing stack-push!
<paroneayea>and fiber B is trying to do asingle stack-push-all!
<paroneayea>since fiber B will try to append an entire list and then spin if it fails
<paroneayea>if A just keeps appending small items
<paroneayea>B may be stuck for a long time or forever?
<paroneayea>maybe this won't happen in practice but I worry about these kinds of things
<ArneBab>rekado: do you know conf? https://bitbucket.org/ArneBab/conf ← my try at autotools templates: conf new <project> — currently mostly supports bash, but adding other project-types just requires adding templates.
<rekado>ArneBab: interesting.
<rekado>ArneBab: I package a lot of bioinfo pipelines and this requires custom version checks all the time.
<rekado>I also need to check for R packages, so I wrote a macro that starts R and tries to load the required libraries.
<ArneBab>having a template with pre-created (but commented-out) checks might help a lot with that.
<ArneBab>It saves reading
<rekado>well, I can also just pour this into an m4 macro file
<rekado>it’s just not something I enjoy doing and it’s error prone
<ArneBab>would it be less error-prone with guile? Wouldn’t that actually add another layer of indirection? Or would you call Guile for the checks?