IRC channel logs

2016-09-06.log

back to list of logs

<zv>is there any way for me to get the 'result' from `(format #t whatever)'?
<zv>as a string
<mark_weaver>zv: pass #f instead of #t
<zv>you are the man as usual mark_weaver
<zv>thanks!
<mark_weaver>yw!
<zv>i owe you dozens of beers at this point
<mark_weaver>:)
<zv>i'm asking for debt forgiveness
<zv>anyway, awesome
<mark_weaver>write some cool free software and it will have been worth it :)
<zv>i'm writing a weechat extension now!
<mark_weaver>what will it do?
<zv>transalte between a gateway and a "real" irc name
<zv>heres the source
<zv> https://github.com/zv/weechat-gateway-replacer/blob/master/nick-converter.scm
<zv>yeah, forgive me, just started to learn lisp a few months ago
<zv>so i'm sure theres some horrors in there, but i did my best
<mark_weaver>cool!
<mark_weaver>at a first glance, it looks like reasonable code to me
<zv>yeah, i saw cut used in srfi source and i use it all the time, such a usual piece of code
<zv>that is the cool thing about guile, tons of really mindblowingly cool stuff
<mark_weaver>:)
<mark_weaver>zv: I have some suggestions for how to simplify 'replace-privmsg'
<zv>mark_weaver: how so?
<zv>i am definitely all ears
<mark_weaver>to begin, why not add some parentheses to the regexps so that 'message' and 'hostmask' are fetchable via 'nth-match' ?
<mark_weaver>but going a bit further, it seems to me that 'regexp-substitute' could perhaps be used here.
<mark_weaver>but I suppose it's a matter of preference whether to use that.
<zv>i didn't know there was a function called regexp substitute
<zv>i would definitely use that
<mark_weaver>it's in the guile manual, search the index
<mark_weaver>in the emacs info reader, you can just type i regexp-substitute RET
<zv>oh whaaaat
<zv>i didnt even know about that keybinding
<zv>this changes everything
<mark_weaver>:)
<mark_weaver>one of the reasons I prefer info manuals
<zv>yeah, i mean, texinfo as a format I hear kindof blows
<zv>but it is so useful
<paroneayea>info is great, as an emacs user :)
<paroneayea>I'm not sure about texinfo as a markup language, or info as a non-emacs user :)
<paroneayea>though sirgazil recently did a really nice theme for texinfo's html export
***octo_ is now known as octophore
<wilfredh>what's the status of R7RS-small in Guile these days?
<sneek>wilfredh, you have 2 messages.
<sneek>wilfredh, wingo says: such patches are welcome :) i think we should use texinfo as the format; there is a facility to turn texinfo in docstrings to ARGUMENTS-IN-CAPS etc
<sneek>wilfredh, wingo says: but we haven't enabled it yet
<wilfredh> http://trac.sacrideo.us/wg/wiki/ImplementationSupport claims that Guile is only partial
<mark_weaver>wilfredh: we have a branch in our git repository that is pretty close to a complete R7RS-small implementation, with just a few missing bits.
<mark_weaver>but it's been lingering there for a while on those missing bits
<mark_weaver>the trickiest one being a serious regression in the efficiency of 'write' after adding support for writing cyclic data.
<mark_weaver>I think I know how to fix that, but I haven't yet found the time to get it done.
<mark_weaver>anyway, it's on the r7rs-wip branch
<mark_weaver>I have to go afk for a while. happy hacking!
<wilfredh>mark_weaver: thanks :)
<wingo>mark_weaver: when you are back :) what memory_model should we be using for atomic boxes? right now it is using the default sequentially consistent model
<wingo>ACTION pushed atomic boxes, whee
<wingo>with full compiler support
<wleslie>(unbox (box wingo))
<wingo>the compiler will not optimize that, on purpose :)
<wingo>so on this laptop with 2 cores and 2 threads per core, spawning 5 threads that do (set! x (1+ x)) 1e7 times each results in a final count of around 1.5e7 (it varies of course) and takes about 1 second (about 4 of run-time).
<wingo>doing the same with atomic boxes and a little compare-and-swap loop for the add (i don't know how to do atomic-add! otherwise given that we need to overflow to bignums) takes more like 20s wall-clock time and 75s run-time
<wingo>but, it actually computes the right number (5e7)
<wingo>i wonder how many retries were needed...
<wingo>anyway
<wingo>i guess it means that under contention on this laptop i can do about 600K compare-and-swaps per thread per second
<wingo>in guile
<wleslie>Acheivement Unlocked: Contention
<wleslie>very cool
<wleslie>600K /condended/ CaS
<wingo>yeah
<wingo>maybe i should try with uncontended cas
<wingo>result is very similar
<wingo>i don't know what the effect of relaxing the memory model would be
<wingo>maybe that means that guile is the bottleneck here, or that the compiler barriers introduced by the atomics are the bottleneck
<paroneayea>hello, *
<paroneayea>today I'm building an emacs client for ActivityPub
<paroneayea>it's weird to hack in elisp after all this time in guile!
<davexunit>wingo: neat re: atomic boxes. I haven't really used boxes in Guile, but I feel like they could help me. what doyou (or anyone else reading this) use them for?
<rekado>sapientech: I'm also using haunt for my blog. Here are the sources: http://git.elephly.net/?p=software/elephly-net.git;a=summary
<wingo>davexunit: normal boxes are just assignables. anywhere you have set!, guile compiles it to a box already.
<wingo>you can use boxes if you have a functional data structure to which you need to introduce mutation
<wingo>atomic boxes are similar but are a separate data type (so that you only use them atomically)
<davexunit>wingo: I think I could use them to simplify my "functional reactive programming" implementation
<davexunit>where I have a box type.
<wingo>except that they have actual semantics when they are being accessed by multiple threads
<davexunit>I didn't know that there was a box data type around all this time
<wingo>well variables are boxes :)
<davexunit>sure
<davexunit>it feels weird to use variable objects in that way...
<wingo>there is also this srfi-111 thing but i don't recommend it because it will be slow. dunno tho :)
<davexunit>but maybe it's fine
<davexunit>wingo: are you saying that boxes are an implementation detail rather than a public interface?
<wingo>well
<wingo>i don't know :)
<wingo>variables are certainly a public interface
<wingo>and they have the semantics of boxes
<davexunit>yeah
<davexunit>I'll look into using variable objects then
<davexunit>thanks
<paroneayea>wingo: here's a band called atomic box: http://atomicbox.net/ :)
<wingo>fun!
<paroneayea>wingo: is this similar to racket's immutable boxes?
<wingo>i.. don't think so? dunno tho
<wingo>the whole point of a box is to be a place to mutate
<paroneayea>I guess I don't know what "atomic" means :)
<paroneayea>wingo: I only know about racket's immutable boxes because of that very point being made in SRFI 111 :)
<paroneayea>Racket and Chicken provide immutable boxes, which look like boxes to box? and unbox but which cannot be mutated. They are not considered useful enough to be part of this SRFI. If they are provided nevertheless, the recommended constructor name is immutable-box.
<paroneayea>oh I see
<paroneayea>wingo: so atomic boxes get inlined?
<wingo>they have vm support so as to go as fast as possible
<davexunit>wingo: could we expose an interface like Clojure's atoms?
<wingo>but they are a compiler barrier, so they prevent some code motion
<wingo>davexunit: certainly
<davexunit>cool
<wingo>could do that before with mutexes and strutures but atomics are better for that
<wingo>ok, busy for a bit, ttyl
<davexunit>later
<rekado>wingo: will they be used for channels?
<rekado>I'm thinking of MVars in Haskell, which are used as synchronisation primitives.
<davexunit>guile almost got an mvar module a few years ago
<davexunit>IIRC, there was some issue with the way threading works that violated the semantics of mvars and thus the patch was never applied
<wingo>rekado: yeah i think so
<wingo>that's why i implemented them anyway
<stis>evening guilers!
<OrangeShark>evening stis
<amz3>héllo #guile!
<stis>heya amz3:
<OrangeShark>hello amz3
<codemac>Is gnu.org down? I can't reach it, and https://isitup.org/gnu.org says it is. jw, thx!
<stis>paralell engines in guile-log >> http://www.c-lambda.se/dependency-and-guile-log.html
<janneke>yup, it's down
<paroneayea>codemac: janneke: https://pumprock.net/fsfstatus/note/K9JzYEetQfqhUD736RkfTQ
<paroneayea>fsf sysadmins are aware
<janneke>tnx
<amz3>almost finished...
<lfam>codemac: This is where the FSF sysadmins announce downtime: https://pumprock.net/fsfstatus
<lfam>And they do confirm a problem
<amz3>sorry for the noise
<paroneayea>djcb: do you use mu4e~foo
<paroneayea>as a convention for a foo method of mu4e that's not a public interface?
<paroneayea>sorry, that's an emacs question not a guile one, I just realized :)
<wingo>ACTION pushed mostly-untested channels impl to fibers
<sapientech>OrangeShark: paroneayea mark_weaver thanks guys! ill def be using haunt
<OrangeShark>sapientech: I am glad it is working for you :) I think haunt should be easy enough to extend to do whatever you want, davexunit did a pretty good job in the design.