IRC channel logs


back to list of logs

<thomassgn>derp, guile complains that I can't use define inside a define... How do I create local variables?
<thomassgn>but it allways tells me 'bad let...' :P
<thomassgn>like here: (let (files (cdr (list-head (command-line) (- (length (command-line)) 1)))))
<thomassgn>gives me 'bad let in form ...'
<thomassgn>huh, so I need 2 parens around the scope...
<thomassgn>holomorph: thanks, makes sense after checking the docs :)
<paroneayea>thomassgn: see also let*
<paroneayea>ooh nice!
<paroneayea>I'll probably promote the new guile release in the morning
<paroneayea>I could do it now, but it'll have more foot traffic earlier tomorrow.
<paroneayea>asdf indeed.
<paroneayea>hello helloGuile, welcome to #guile ;)
<helloGuile>hmm emacs erc how to connect #guile channel?;; irc server address is right?
<paroneayea>helloGuile: M-x erc <RET> <RET> 6667 <RET> helloERC <RET> (wait for login) /join #guile <RET>
<helloGuile>thanks ah;
<helloGuile>I'm PlumpMath guile beginner (and scheme);; nice to meet you & everyone :)
<paroneayea>nice to meet you too PlumpMath :)
<paroneayea>hope you have fun in our land of parentheses.
<davexunit>(greet! "PlumpMath")
<davexunit>ACTION works on rewrite of graphics engine
<PlumpMath>hi everyone~ I like GNU~~ :)
<davexunit>ACTION for a few minutes at least...
<paroneayea>I'm back from a fun dentist appointment (filling popped out) which interrupted the middle of my day
<paroneayea>back to hacking 8sync's agenda to use the new suspendable ports.
<davexunit>ACTION has a lot of fillings (and a crown)
<paroneayea>yeah it happened while eating a nice carmel I had gotten as a gift
<davexunit>luckily nothing has fallen out yet...
<paroneayea>and then the carmel smushed right into the filling hole
<paroneayea>sugar right against the opening
<paroneayea>pretty painful
<davexunit>hurts just thinking about it
<paroneayea>luckily I work from home so nobody would judge my arms flailing run to the bathroom to brush it out of my teeth
<davexunit>a luxury, for sure.
<paroneayea>trying to understand a pile of baroque abstractions a previous me wrote. nice job, old self.
***logicmoo is now known as dmiles
<ArneBab>paroneayea: :) — that’s a great way to learn writing maintainable code
<paroneayea>ArneBab: ;)
<paroneayea>Luckily sleep and a shower made things clear
<paroneayea>and I think I know how to refactor to make 8sync a much nicer place *and* integrate suspendable ports :)
<dsmith>Morning Greetings, Guilers
<lloda>need help with a threading problem, It happens only after aa84489d18320df086e08554554d6f3b92c45893 'Reimplement dynamic states' on the master branch.
<ArneBab>paroneayea: nice!
<lloda>deadlock in make_bytevector in the call to scm_gc_malloc_pointerless
<lloda>here's the backtrace:
<lloda>there are a bunch of threads just like #2
<lloda>gc version is gc7_6_0 which I updated to after finding the deadlock in an earlier 2015 version
<lloda>I mean with an earlier 2015 version
<dsmith>lloda: Aww Fouey. And wingo just did a release yesterday
<wingo>i can cut another one :)
<lloda>it happens only after I create some pretty large arrays (GB), but it didn't happen before
<lloda>before aa84489d18320df086e08554554d6f3b92c45893 I mean
<wingo>yep i can see how that happens
<wingo>so it seems that we should not try to get the current warning port from that function and instead just write to stderr
<wingo>lloda: does that make sense to you?
<lloda>ah, the large allocation warning
<lloda>not familiar with those routines, but in the situation it makes sense
<lloda>so we should just fprintf(stderr...)?
<lloda>yet the comment at scm_gc_warn_proc says 'cannot allocate GC memory'. So it does it anyway through the weak table thing?
<wingo>it's not allocating memory
<wingo>just that the weak table has weak cells which aren't safe to reference outside the allocation lock
<wingo>so accessing cells in the weak table goes to take the lock
<wingo>but the lock is already taken, so deadlock.
<davexunit>wingo: does one need to use multiple pthreads to do profiling with system-async-mark? my assumption is "no" but the implementation isn't clear to me.
<lloda>wingo: why doesn't it wait for the lock to be released? sorry if this is a stupid question
<davexunit>to learn, I wanted to write a form that would handle every interrupt opportunity and count how many times it happened.
<wingo>lloda: because the same thread took the lock
<wingo>lloda: it's already issuing the error while having the lock
<wingo>davexunit: no, you can use signals
<wingo>that's what statprof does
<wingo>signals use system-async-mark under the hood
<lloda>ah oh for the malloc you mean
<lloda>I just assumed it was some other thread somehow :-|
<lloda>anyway patching scm_gc_warn_proc does fix it for me to be sure
<lloda>thanks for the support wingo :)
<davexunit>wingo: okay I will look. thanks!
<wingo>lloda: np :) feel free to submit a patch that just rips out that code and replaces with a write to stderr
<lloda>will do
<davexunit>wingo: are signals not in the manual. the index brings me to the POSIX section of the manual.
<davexunit>that first sentence was a question :)
<wingo>signals are in the manual i think :)
<paroneayea>hi #guile
<paroneayea>heya everyone
<paroneayea>sinkbot: hi
<sinkbot>Oh hi paroneayea!
<paroneayea>sinkbot: botsnack
<sinkbot>Yippie! *does a dance!*
<paroneayea>sinkbot: d20
<sinkbot>paroneayea: *rolls*... you get a 19!
<paroneayea>so, good news everyone!
<paroneayea>8sync is running using (ice-9 suspendable-ports) :D
<paroneayea>and that's powering sinkbot above
<paroneayea>and it CONSIDERABLY simplifies writing networked code.
<paroneayea>wingo: ^^ :)
<wingo>wow neat :)
<wingo>that's cool
<paroneayea>sinkbot: root for (ice-9 suspendable-ports)
<sinkbot>Woo woo (ice-9 suspendable-ports)! :D
<paroneayea>I also had a nice revelation this morning about how to simplify a whole lot of things in 8sync
<davexunit>sinkbot: (delete-file "/tmp/foo")
<sinkbot>*stupid puppy look*
<davexunit>sinkbot: help
<sinkbot>I can't help you... I can't even help myself!
<paroneayea>sinkbot: sorry davexunit tried to use you maliciously.
<sinkbot>I accept your apology.
<paroneayea>sinkbot is a delightfully useless bot.
<sinkbot>*stupid puppy look*
<paroneayea>wingo: I also thought a lot about the conceptual overlap between what you're doing with channels and what I'm doing with the actor subsystem
<paroneayea>maybe it's worth writing up, I dunno!
<davexunit>I've been using a channel-like construct in my async game prototype
<paroneayea>8sync's core agenda doens't really provide a way to coordinate between the different concurrent things you split up. but the actors mechanism does provide a coordination mechanism
<wingo>i always think writing things up is worth it :)
<paroneayea>at the heart of it, they're both about coordinating between different inboxes of messages of sorts
<paroneayea>but... there are some clear differences too
<davexunit>I'd be curious if actors would be better
<paroneayea>I'm considering making the actors subsystem not require using GOOPS classes
<paroneayea>and just have a constructor function for an actor (which can be anything, including something that knows how to construct the GOOPS class), and the actor provides a procedure to send it messages
<paroneayea>and in that case, if you want, you really don't need GOOPS, but GOOPS can be used by those who like GOOPS.
<paroneayea>anyway, I should remove the debugging statements from this code and commit it :)
<paroneayea>davexunit: by next release I'll try to have decent docs in 8sync, maybe you can give 8sync's actors concept a try and think about it from there :)
<paroneayea>and maybe it would apply nicely to your game engine, maybe not, but it could give you a conceptual place to think about it from
<davexunit>paroneayea: sounds good :)
<davexunit>I would probably snarf rather than use directly, since I have my own coroutine implementation with job control and such at this point
<paroneayea>davexunit: yeah makes sense
<paroneayea>davexunit: I think the main value to you will be to play with how 8sync does it
<davexunit>but to see an implementation of the concept would be nice
<paroneayea>actors are pretty easy to implement
<paroneayea>another thing I need to do in 8sync is stop using select, heh ;)
<davexunit>right now I'm using a channels-like thing to have threads yield when processing input events and stuff, but you can make a channel for anything.
<paroneayea>davexunit: cool :)
<davexunit>don't yet know how well it works in practice.
<davexunit>I currently have concerns about live hackability
<davexunit>that I'm hoping I've somewhat addressed by making coroutines a first-class datatype and adding a define-coroutine form that will stop the current version of itself when it is redefined at the REPL.
<davexunit>but we shall see...
<paroneayea>one really cool thing about using suspendable ports
<paroneayea>I was able to convert a 32 line function where I did all the buffering on incoming socket data from irc
<paroneayea>to a 6 line function that just used (read-line socket) and looped
<paroneayea>ACTION feeling exuberant
<dsmith>paroneayea: Cool
<daviid>paroneayea: I'd be happy to read some doc about 8sync too
<daviid>paroneayea: I would not loose any time, not even a second to (re)writing sonething that will 'mimic' oop, in a poor way by def (msg passing is not good) where goops does the job, my 2c :)
<paroneayea>daviid: the actor model already uses message passing
<paroneayea>I used GOOPS *and* message passing
<paroneayea>the message passing component is used to coordinate between concurrently executing actors
<daviid>ah ok
<daviid>paroneayea: so, how about doing things the other way around, maybe, rewrite that part so that it uses goops?
<daviid>remember, at that time, msg pass is all they knew ...
<daviid>earling actor model articles I mean...
<paroneayea>daviid: then various properties of the system wouldn't work I think
<daviid>paroneayea: ok
<paroneayea>especially the ones that allow you to communicate with remote actors on other processes/servers
<paroneayea>you *could* do the message passing as procedure calls, but it would involve currying, and it would only work for local actors I think
<daviid>I see, but this is not much oop anyway, you 'just' write on a socket, pipe or what ever ... and the other read
<paroneayea>right, but what does the abstractions for all that look like in the end?
<paroneayea>back to hacking :)
<paroneayea>daviid: also, thanks for the offer to review docs once they're ready, I'll likely take you up on it :)
<daviid>paroneayea: yes, back to hacking, and welcome...
<paroneayea>daviid: also, whether or not there's an option to not use GOOPS in actors, I'll probably still use it... GOOPS'y actors are a lot of fun :)
<paroneayea>they certainly made hacking on mudsync a blast.
<dsmith>Hey! Is gmane back online?
<dsmith>Hmm. Sort of.
<paroneayea>too much time in Guile has left not as excited with format string literals in Python 3.6 as I once would be :)
<paroneayea>"not as cool as using fmt" I think to myself
<dsmith>paroneayea: Seems like most things I have to do in python are "not as cool as ..."
<janneke>ACTION thinks....hmm fmt?
<paroneayea>I got it working in Guile
<paroneayea>it's pretty nice.
<paroneayea>formatting combinators.
<paroneayea> to be blown away.
<thomassgn>I have the following expression: (system* rsync transport options progress files dest) where files is a list of files e.g. ("testfile" "tst"). I get 'Wrong type (expecting string): ("testfile" "tst")' and I can't figure out how to "get them out of list". I have found list-ref, but not sure how to make do...
<thomassgn>Any tips?
<janneke>i particularly liked/miss python's "fooo %(bla)s" % locals () trick
<paroneayea> is the canonical documentation I guess
<janneke>fmt seems to address that, and more?
<paroneayea>by the same wonderful person who brought us irregex
<paroneayea>using irregex is a dream.
<paroneayea>not always very fast though :)
<paroneayea>guile-irregex is packaged in guix fwiw. fmt isn't yet
<paroneayea>in case someone wants to package fmt ;)
<paroneayea>or try irregex!
<paroneayea>I would describe irregex as "imagine if you could write insanely complicated regular expressions and then read them just fine later."
<kyamashita>ACTION clicks irregex link immediately
<paroneayea>I wrote a "parser" (not really a parser) for the Ledger command line accounting text format one night in about an hour
<paroneayea>and came back and tweaked it several months later
<paroneayea>and it was like I never left it
<dsmith>thomassgn: So want something like (system* r t o p '("a" "b" "c") d) to be (system* r t o p "a" "b" "c" d) ?
<thomassgn>dsmith: exactly
<paroneayea>kyamashita: you may like looking at then :)
<paroneayea>composable regexes!
<dsmith>thomassgn: Hmm. Maybe you gather up files and dest into a list and then use apply.
<dsmith>Something like (untested): (apply system* r t o p (append files (list d)))
<thomassgn>dsmith: mm, seems like it works. It does end up having null at the end of the list, which it complains about.
<thomassgn>might be a step forward, will check docs and try some more :)
<kyamashita>paroneayea: This is so cool. I know what I'm using for regex in Guile!
<dsmith>thomassgn: Is dest a string or a list?