IRC channel logs

2016-05-22.log

back to list of logs

<schwa`>Hi, I was curious if anyone is using guile as a web development backend in production and how that stack looks like?
<jmd>What does ~% mean in a format string?
<jmd>Is there a way to use define-record-type and specify a predicate such that fields will be automatically checked that they satisfy some condition?
<efraim>from https://www.gnu.org/software/guile/manual/html_node/POSIX.html#POSIX do I have to add any modules to use posix or is it "free"?
<random-nick>efraim: it's all global
<efraim>awesome
<amz3>héllo :)
<jmd>moin
<jmd>What is the cost of calling make-fresh-user-module ?
<wingo>4 or 5 euros usually
<wingo>can be more if you get it in a cone
<jmd>hoho!
<jmd>I just wondered if it took a lot of resources. Should I create just one and reuse it, or is it ok to create lots dynamically as I need them?
<wingo>hard to say
<wingo>i would do benchmarking and see if it matters to your use case
<jmd>ok.
<wingo>making a fresh module allocates around a kilobyte maybe. that's the major cost.
<jmd>I can probably afford that if the GC behaves itself. I was more worried about time cost.
<jmd>Hmm. Seems to take about a second longer in my use case.
<jmd>When using define-record-type, is there a way I can force the fields to by of a particular type/format?
<wingo>ACTION realizes that there is 16 months of unported things from stable-2.0 that have not landed on master :(
<wingo>:(((
<holomorph>:(
<masoudd>:\\ what happened
<wingo>i guess master was in too much flux for people to land changes there
<wingo>in practice stable-2.0 is what ships to most people
<wingo>but it used to be it was the responsibility of the person landing the patch to get it onto master
<wingo>ACTION cherry-picked the things i could
<wingo>no more merges from stable-2.0 i think, we have diverged!
<justin_smith>is there a guile module for STM?
<wingo>not that i know of
<wingo>i assume you mean software transactional memory
<justin_smith>yes
<wingo>would be nice tho :)
<justin_smith>yeah, I have a project I could use guile for (raspberry pi doesn't have much RAM and I can't use clojure which I use for my day job)
<justin_smith>and in clojure I would be using STM to coordinate values between threads
<justin_smith>is there something else beyond locking and shared access?
<wingo>sadly that's not a thing in guile right now, we are in the dark ages as far as concurrency patterns
<justin_smith>OK - thanks
<wingo>well, futures are nice
<wingo>but that's a bit of a limited interface
<justin_smith>I'll look at futures, thanks.
<wingo> https://www.gnu.org/software/guile/manual/html_node/Futures.html
<wingo>ok so the release will slip a little bit (just a couple days), i want to be sure i can run the web server with non-blocking i/o
<wingo>still have a few primitives to implement
<justin_smith>what about some equivalent to racket thread mailboxes ?
<daviid>wingo: how about fixing bug#20093 [if not already, I don't know] before the next release?
<wingo>justin_smith: at one point i had an async queue implementation
<wingo>i was doing more gnome-style programming then
<wingo>so if you've ever done threads with gnome libraries, it's like gasyncqueue
<wingo>i could dig that up, it's somewhere...
<wingo>but to answer your question, yeah, we need to steal from people with good patterns :)
<wingo>generally i love to steal from racket but i am not sure if they are the right ones to steal from given the way their multi-processing support has developed over the years (afaiu: excellent user-space threads, not so great SMP)
<wingo>daviid: i will see what i can do :)
<daviid>wingo: thanks!
<daviid>justin_smith: wingo fwiw, I'm using guile-a-sync, which also has a module to cooperate with glib. yesterday, I have a working guile-a-sync, guile-inotify2, glib example [file watch] and a clutter actor refreshing itself using the file watch results [png images as calculus goes on]. Clutter is tremendously sensible to anything doing with actors and content [images, cairo...] must be done from within an idle-add timeout-add from the main
<daviid>thread only
<daviid>in clutter you can't even set-dada from a gdk-pixbuff to the <clutter-image> from another thread: cogl raises an exception saying there is no data, unless done from within the main thread. anyway, slightly OT, but guile-a-sync is great
<daviid> https://github.com/ChrisVine/guile-a-sync.git
<daviid>justin_smith: ^ worth a look, it has some doc and examples
<wingo>thank you for the pointer! i had not seen this library before
<daviid>cris really knows what he is talking about and has a very big experience wrt glib [and gtk as matter f fact]
<wingo>are they on irc?
<daviid>wingo: I did aks [private eail] if he is here, under what nick if..., but he did not answer :(
<wingo>this is a very interesting use case that is related to the work i have been doing recently on ports
<wingo>anyway, looks very nice
<wingo>i wonder if they have talked with paroneayea yet
<daviid>wingo: _and_ it works: without that lib, I could never reach my Clutter app goal [still a mock-up for now but...]
<daviid>they did exchage some emails yes
<wingo> https://github.com/ChrisVine/guile-a-sync/blob/master/a-sync/coroutines.scm <- about 5 times more comments than code; that's my experience with prompt tags too
<daviid>:)
<wingo>what a delight. looks very nice.
<daviid>yes it does. here is my use case: http://paste.lisp.org/+6S9P yu can try it
<wingo>i hope we see a lot of experimentation in this area in the next couple years.
<daviid>I do to: my wrok crutially depend on these libs
<daviid>work*
<wingo>hehe one day we will have the javascript problem of which framework to choose ;-)
<daviid>oh to run 'my use case' you need to clone https://github.com/ChaosEternal/guile-inotify2.git,
<daviid>wingo: yes, 8sync, a-sync ...
<wingo>ethreads ;)
<daviid>and copy the linux/inotify2.scm -> share/guile/linux/inotify.scm [and edit to remove the 2 from the module name] guile-inotify2 is not tool chained, so manuall ... but it is 1 file only
<daviid>I ment share/guile/site/... of course, you got that :)
<random-nick>is there something for guile scheme like the common lisp iterate library?
<wingo>good evening civodul :)
<daviid>wingo: this reminds me there is a serious guile-gnome bug I can fix alone :( I posted this at the time http://paste.lisp.org/+6LP8 it _really_ would be wonderfull if you could look at it! [so much to do I know... but it is a serious bug...] you just need to drop it, chmod a+x ..., and run it, it will segfault after a little while. as it is, it runs (test-4), change line 66 if you want to run other test(s)
<daviid>I really wish I could debug this alone but it's behond my knowledge for now
<daviid>I ment to write: 'I can not fix alone ...'
<civodul>hey, wingo!