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? <jmd>What is the cost of calling make-fresh-user-module ? <wingo>can be more if you get it in a cone <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>i would do benchmarking and see if it matters to your use case <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>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! <wingo>i assume you mean software transactional memory <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 <wingo>but that's a bit of a limited interface <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 <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>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>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>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] <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>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>what a delight. looks very nice. <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 <wingo>hehe one day we will have the javascript problem of which framework to choose ;-) <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? <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 ...'