IRC channel logs


back to list of logs

<paroneayea>going to try to build an irc client with this async loop I've written
<paroneayea>irc bot :)
<daviid>paroneayea: i-sink maybe ? [like I do/can sink to man...!]
<daviid>or i-sinc, k-sink, k-sinc [kitchen...]
<paroneayea>hey mark_weaver
<paroneayea>if you (or someone else knowledgeable about guile's select) is around, I have a question about (select)
<paroneayea>sneek: tell mark_weaver how do we distinguinsh between ports that work with (select) and those that don't? Is there a way to add new port types that fit with (select) if useful?
<sneek>mark_weaver, paroneayea says: how do we distinguinsh between ports that work with (select) and those that don't? Is there a way to add new port types that fit with (select) if useful?
<paroneayea>sneek: later tell mark_weaver how do we distinguinsh between ports that work with (select) and those that don't? Is there a way to add new port types that fit with (select) if useful?
<nalaginrut>morning guilers~
<paroneayea>morning nalaginrut
<paroneayea>ports are working nicely with this even tloop implmentation
<polyphagia>if i'm using embedded guile in a C program for configuration, what's the best way to change that file from the C program?
<polyphagia>for configuring controls or something
<taylan>polyphagia: what do you mean with "change that file"?
<taylan>do you mean e.g. setting the value of a Guile variable, which contains the file's path, to a different Guile string, from C?
<taylan>or do you mean editing the file somehow?
<polyphagia>i'm planning to use guile for a configuration file for game controls, but i want the user to be able to map them in the C program
<polyphagia>and save it to the configuration file
<polyphagia>or just edit it manually if they want to
<polyphagia>so yeah edit the file
<taylan>isn't that a C programming question then? :) or do you need advice on the overall strategy? I imagine there's many ways to do it... I think I would declare a configuration data structure, which could be a Guile record type, and saving the config would entail writing the values in the data structure into the file. all this could be implemented in Guile, and C code could just invoke Guile
<taylan>(it could also be a plain alist, or hash table, instead of a record type...)
<polyphagia>yeah i was just going to use an alist
<polyphagia>so how do i go about writing the values? just a format string?
<polyphagia>i'd like it to be pretty-printed
<taylan>(pretty-print the-alist file-port)
<taylan>from the module (ice-9 pretty-print)
<polyphagia>it messes up with quotes though
<polyphagia>it puts "quote" in instead of actual quotes
<polyphagia>why is that?
<taylan>pretty-print uses 'write' style by default it seems. that should be correct. can you give an example?
<polyphagia>sorry i'm still new to scheme
<taylan>oh you mean like (quote foo) instead of 'foo maybe?
<polyphagia>and then it doesn't read it back in
<polyphagia>>bad syntax in form quote
<taylan>'foo is equivalent to (quote foo) anyway for the reader...
<taylan>what's output by 'pretty-print' (or 'write') should be input via 'read'
<polyphagia>well alright then
<taylan>then it will work, unless an "unprintable" object was in the output, like a procedure, record type, or hash table, which are written in some human-recognizable way but can't be read back in exactly
<polyphagia>that's perfect then
<polyphagia>i can use C calls then
<taylan>yeah read/write is really amazing :)
<polyphagia>this is much easier and more robust than just rolling my own config garbage
<polyphagia>i got the idea from supertux lol
<polyphagia>thanks a lot taylan
<taylan>happy to help
<dsmith-work>Happy Friday, Guilers!!
<mark_weaver>paroneayea: sneek just delivered to me your question about ports that work with 'select' on #guix.
<mark_weaver>I will look into it
<mark_weaver>I guess that file and socket ports are the only ones that currently work with select
<mark_weaver>specifically, ports that have an underlying POSIX file descriptor
<mark_weaver>but, it occurs to me that it may be theoretically possible to create custom ports that can also work with 'select', and that it may be important in some contexts to be able to do this, although I imagine it may also be a bit hairy to implement such a thing, and worse, the API may be hairy.
<mark_weaver>I'll think on it.
<wingo>ACTION has unboxed 64-bit integers working in a dev branch
<paroneayea>mark_weaver: great, thanks!
<paroneayea>mark_weaver: I have the basics of the async loop library working btw
<paroneayea>I'm going to try to write an irc bot today to test it
<paroneayea>and then add some licensing stuff and push it to a repo
<davexunit>wingo: is there anyway that floating point ops can be unboxed on 32 bit platforms?
<davexunit>I've been getting more into ARMv7 stuff lately
<mark_weaver>paroneayea: at present, the 'fileno' procedure, which returns the POSIX file descriptor underlying a port, can be used to determine whether a port can be used with 'select'.
<mark_weaver>if it can't, then 'fileno' will raise an exception, so you can do (false-if-exception (fileno port))
<mark_weaver>but that won't take into account any future custom port types that we may add that would support 'select'.
<paroneayea>mark_weaver: okay, excellent, thanks for clarifying
<mark_weaver>anyway, that's great news about the async loop library!
<paroneayea>ACTION moves that info to his notes
<paroneayea>mark_weaver: yeah!
<paroneayea>mark_weaver: so the first version I used all internal guile datastructures, including mutable queues, so the first version does rely on imperative mechanisms
<paroneayea>mark_weaver: but I'm planning on starting a branch that uses all functional datastructures, maybe from pfds
<mark_weaver>it's okay, everything that runs on existing computers uses imperative mechanisms at some level.
<paroneayea>yeah, well the goal of that is it could maybe give us cool features like time-traveling debugging like in Elm (and in the future, Sly)
<mark_weaver>to my mind, the more important thing is whether the API promotes or hinders functional programming above it.
<paroneayea>mark_weaver: *nod*
<mark_weaver>(e.g. traditional hash tables are an example of an API that hinders functional programming above it)
<mark_weaver>oh, sure, makes sense :)
<wingo>davexunit: they are!
<wingo>davexunit: on the stack at least. if they escape from loops or whatever they are boxed on the heap, same as now
<paroneayea>ACTION needs to add docstrings still to the whole thing, but has a reasonable number of tests so far
<davexunit>wingo: awesome! thank you once again :)
<wingo>but in master all heap slots are 64 bits wide
<mark_weaver>wingo: did you mean to write "stack slots" ?
<wingo>mark_weaver: yes, sorry!
<wingo>stack slots
<mark_weaver>okay :)
<rekado>dear Guilers, for FOSDEM 2016 we currently only have four talks for the Guile devroom.
<rekado>you can submit a talk proposal here:
<paroneayea>rekado: I'll publish on Guile's social streams
<paroneayea>civodul: hm, could you make a post to the guile blog calling for guile/guix talks at fosdem?
<rekado>paroneayea: thanks!
<rekado>civodul: does chop-backup support garbage collection or deletion of chunks that are unique to a single backup version?
<paroneayea>I'll submit now, and again if another posting for talks goes up.
<rekado>I'd really like to use chop-backup instead of my brittle rsync "backup", but ultimately I have limited space on the external disk and I'd like to be able to prune the backup store once in a while.
<civodul>rekado: no, no GC
<civodul>it's append-only, remove-never ;-)
<civodul>paroneayea: yes, probably!
<paroneayea>promoted the CFP and submission link
<rekado>civodul: is this by design? Is it possible to remove? Is there some sort of reference counting?
<civodul>no currently there's no reference counting
<civodul>it's actually harder to add a GC à la Git
<civodul>because meta-data may be encrypted
<civodul>so you can't tell which blocks are referenced and which are not
<civodul>yeah ;-)
<civodul>you could think of it as one of these backup tapes
<rekado>that's a bit of a problem for me, because I don't know where to safely store this ever-growing append-only mass.
<rekado>I use full disk encryption on my backup disks. Maybe I can assemble my own non-encrypted, reference-counting backup pipeline with the tools libchop provides.
<mark_weaver>I currently use 'rsync -aP' along with 'cp -al' to keep multiple backups with sharing (deduplication) via hard links
<civodul>rekado: yes, maybe
<mark_weaver>my only real complaint with this method is that it requires running 'rsync' as root on the machine that's only storing the backup.
<civodul>rekado: i wouldn't claim chop-backup is production-ready, so care must be taken
<mark_weaver>another system that looks promising to me but I haven't yet tried it is "obnam"
<mark_weaver>by Lars Wirzenus
<civodul>GnuPG + snapshots feel wrong to me
<civodul>i think content-addressed storage is better suited
<civodul>Ugarit does that too, and it's written in Chicken Scheme
<rekado>I like Ugarit but we currently don't have a working Chicken Scheme in GuixSD ...
<paroneayea>chicken scheme in guix would be cool
<rekado>I want to use a CAS-based system because I have multiple machines each holding a subset of all files.
<paroneayea>I'd love to play with some of those libraries
<rekado>my laptop only holds a fraction of all files, but I also sometimes do things on my desktop machine, so I cannot just overwrite everything with what I have on my laptop.
<rekado>so backing up the latest versions to an external disk by rsync'ing becomes very difficult (I want to use --delete as I often move around stuff and remove unused files).
<rekado>with a CAS I could just back up all machines to the shared storage, without having to worry about accidentally overwriting files.
<csed>I'm basically sending this to every IRC channel I'm in.
<mark_weaver>csed: with javascript disabled, I can't even *read* that article. that's obnoxious :-(
<mark_weaver>ACTION goes afk
<civodul>mark_weaver: i think it's just empty, which is the funny part
<csed>Huh. Anyone ever try setting up Guix on an RPi?
<amz3>AFAIK RPi requires blobs to be fully operational
<daviid>csed: #guix would be more appropriate for these quizz
<csed>Oh, I'm in #guile.
<csed>Nevermind. But amz3, yeah. Requires blobs.
<daviid>csed: not that it is a problem, but more people will be abble to help you wrt any guix guixsd releated quizz, in #guix :)
<csed>daviid: Yeah, agree. Forgot which channel I was in.
<paroneayea>YESS delimited continuation support in loopy is working
<mark_weaver>civodul: oh, I see. okay, I agree, that's amusing :)
<mark_weaver>paroneayea: \\o/
<mark_weaver>csed: Guix won't work on an RPi. It's not armv7
<paroneayea>so main problem
<paroneayea>is that I'm using (async)
<mark_weaver>it should work on a Beaglebone Black though
<paroneayea>which kind of conflicts with the main library's (async)
<paroneayea>but it's such a nice name to use
<paroneayea>I guess if people hit conflicts, they can import namespaced
<paroneayea>so no problem (... right?)
<mark_weaver>paroneayea: I would rename it
<paroneayea>mark_weaver: ideas on better names?
<mark_weaver>sorry, at radio now, busy...
<daviid>paroneayea: i would rename it too, fwiw
<daviid>ssinc [like sxml but for sinc?]
<daviid>don't know really
<daviid>but i'd rename it :)
<paroneayea>well the synchronous things use (run) so maybe I should do (run-free) ;)
<paroneayea>(azync (foo))
<paroneayea>I kind of hate hitting z though :)
<daviid>does not sound so good to me
<paroneayea>(parallel) doesn't work, because it isn't really parallel
<daviid>cawasinc [yourname asinc]
<daviid>dsmith-work: your good at finding names ... where are you ? :)
<daviid>i used 9 for ice-9 of course, what would be 8 for?
<paroneayea>a pun
<paroneayea>on a-sync
<paroneayea>say it out line
<daviid>what is a pun ? [sorry ot native speaker here]
<paroneayea>daviid: ah, a joke that involves words or how you pronounce things
<paroneayea>"eight sync" sounds like "a-sync" in english
<daviid>ah ok
<paroneayea>plus 8 looks like a sideways infinity so :)
<daviid>i prfer 9sinc
<paroneayea>I almost did %async
<paroneayea>because it's using a prompt
<daviid>oh that is good
<paroneayea>but I bet people would type (async) instead of (%async) a lot as a mistaked
<daviid>i think it's a good name , what other people think ?
<daviid>well you can alwasy amke a not [the % is on purpose ... or something like that
<paroneayea>(%async (run-this))
<paroneayea>it's not so bad
<daviid>I like it
<paroneayea>I just worry I'll so (async (run-this)) a lot and get confused :)
<paroneayea>%sync, and the % could become the a :)
<paroneayea>so we'll run things %synchronously
<daviid>hum don't know i prefer %async, but then ...
<paroneayea>my main worry with %async
<paroneayea>is if you do (async)
<paroneayea>it won't throw a clear error
<paroneayea>which could lead to a lot of confusion
<daviid>i understand
<paroneayea>I think I'll go with (%sync) for now
<paroneayea>it's a nice compromise, and at least it has a little joke in it :)
<daviid>has async ...
<daviid>fasync [functional async
<daviid>f-async maybe better
<daviid>ok, i'll stop here :)
<daviid>not good at this, but f-async sounds good to me
<daviid>with all due respect better then %sync :)
<daviid>ACTION hides
<daviid>paroneayea: did you use the code or some of it from cris vine ?
<paroneayea>daviid: the code is all original
<daviid>wow, impressive
<paroneayea>daviid: though inspired by learning about SICP and Sly
<paroneayea>reading SICP section 3
<daviid>i'd have to read it again, gone out of my poor mem :)
<daviid>good! i'm curious how your solution compares to criss one
<dsmith-work>daviid: Eh?
<daviid>just curious
<dsmith-work>Hmm. I like f-sync
<daviid>dsmith-work: paroneayea is looking for a name for his module doing async ... i thought you may join the attempt to find a good name ...
<dsmith-work>ACTION runs
<daviid>f-async is my prefered, paroneayea prefers %sync
<paroneayea>dsmith-work: it's not for the module
<paroneayea>it's for the macro that calls code asynchronously
<paroneayea>so it has to be short
<daviid>ah %async is better then sorry misunderstood :) oh man must be tired
<paroneayea>daviid: well it's not all purely functional yet, and it does use a parameter to find the default async loop (unless you pass it in)
<daviid>%async, not %sync imo ...
<dsmith-work>daviid: I'm quite terrible at naming things. You'd be shocked at some of them.
<dsmith-work>struct some_thing { ... }; for example.
<paroneayea>I have to say, it's pretty nice being able to do
<daviid>dsmith-work: ok, i had the opposite idea that you were good atthis
<paroneayea>(+ 1 2 (async (get-some-number)))
<paroneayea>and have it return with that value, but in a non-blocking manner
<dsmith-work>daviid: I've had some fun coming up with backronyms in the past...
<dsmith-work>Something to consider for a good project name is uniqueness.
<dsmith-work>So global internet searches actualy retunr useful matches
<paroneayea>that might be a good unique name for this project, better than "loopy"
<paroneayea>because 8 looks like a sideways infinity :)
<paroneayea>and then I can use (8sync) and not feel bad about it :)
<daviid>very good paroneayea