IRC channel logs

2014-09-30.log

back to list of logs

<Profpatsch>What would I use for an argument like direction in (define (line x y len direction) …) where direction is one of n w s e?
<Profpatsch>Symbols?
<mark_weaver>yes
<mark_weaver>that would be the traditional scheme approach, anyway
<Profpatsch>I was searching for keywords, but these are for keyworded arguments I guess.
<mark_weaver>right
<mark_weaver>if you prefer, R6RS also has an (rnrs enums) module, but I've never used it.
<Profpatsch>Is ( … . args) the only way of specifying keywords? Racket has a pretty nice implementation (http://www.cs.utah.edu/plt/publications/scheme09-fb.pdf)
<mark_weaver> http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-15.html
<mark_weaver>Profpatsch: no, guile has 'define*', 'lambda*', and 'case-lambda*' that support keyword arguments and optional arguments more nicely.
<Profpatsch>Oh, ok.
<mark_weaver>see section 6.9.4.1 of the manual
<mark_weaver>fwiw, there's no technical reason why you can't pass keywords for the 'direction' argument above. they need not only be for keyword arguments. however, this would be a unusual use for them.
<paroneayea>davexunit: I'm gonna ask this in here because it's more of a #guile question than a #sly question I guess :)
<mark_weaver>but technically, keywords are essentially the same as symbols except that they are "self-quoting".
<paroneayea>I'm trying to see how the Makefile.am works in sly... how does it know to compile the .scm files .go with guild, etc?
<paroneayea>oh, is that because of $GUILE_TOOLS?
<paroneayea>oh
<paroneayea>I see now ;p
<davexunit>paroneayea: I use some guile-provided autotools stuff
<paroneayea>oh, where should I find that?
<davexunit>I don't really know, actually. I've gotta be honest: I'm pretty clueless when it comes to autotools.
<davexunit>I got it to work and then promptly forgot how...
<paroneayea>heh :)
<paroneayea>I'm trying to understand the stack and getting pretty lost :)
<davexunit>I'm learning a bit more by looking at the guix configure.ac and Makefile.am files
<mark_weaver>davexunit: where can I find sly?
<mark_weaver>(not very searchable :)
<davexunit>someone also recently forked SLIME and named it SLY.
*davexunit sighs
*davexunit slys
<mark_weaver>heh
<davexunit>mark_weaver: there's no website or anything, just a gitorious repo: https://gitorious.org/sly/sly/
<davexunit>the master branch hasn't been updated in awhile, I've been working in the scene-graph branch.
<mark_weaver>hmm, I tried "git clone git@gitorious.org:sly/sly.git", and it failed with "Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists."
<davexunit>use https://gitorious.org/sly/sly.git
<davexunit>gitorious should really show that URL by default instead
<mark_weaver>ah, good
<davexunit>the SSH url gives read/write access.
<davexunit>the 3d engine demo'd at racketcon is inspiring.
<davexunit>if I can just make a scene graph API that doesn't suck I can lock-in and spend the rest of my time writing docs and cleaning things up.
<paroneayea>okay, yay, figured out how to get @GUILE_TOOLS@ to work in makefile.in
<paroneayea>don't use $(GUILE_TOOLS), that's the ticket ;)
<davexunit>I made paroneayea a silly animated birthday present using Sly the other day: http://media.dthompson.us/u/davexunit/m/happy-birthday-b2fc/
<paroneayea><3 <3 <3 <3 <3
<davexunit>the source code is not too bad.
<paroneayea>davexunit: A nice 30th birthday present for a secret other reason: I've always been jealous that when my older sister was born that my dad wrote a "happy birthday elizabeth" program in basic on our c64 with the letters bouncing around, and he never did that for me. I was always quietly jealous of that
<paroneayea>so seeing bouncing happy birthday letters made me pretty happy :)
<davexunit>well I'm glad I chose the sine function!
<mark_weaver>paroneayea: to answer your question about how .scm files are compiled to .go in sly: the rules are in guile.am
<paroneayea>:)
<davexunit>oh yeah, I took that from somewhere...
<paroneayea>mark_weaver: thanks for confirming, I was starting to think that
<paroneayea>I have it mostly reproduced in my non-automake but autoconf setup
<paroneayea>I'm trying to sloooowly work my way up
<paroneayea>start with makefiles
<paroneayea>add autoconf stuff till I understand that
<paroneayea>*then* do automake.
<paroneayea>otherwise else I think it'll stay magic for me.
<paroneayea>yay it's working, yayyyy
<paroneayea>once I get this working enough to where it executes remote code locally I'll push my guile deployment tool prototype live and ask for feedback or something :)
<davexunit>oooh
<Profpatsch>wat. Why does it warn that I can’t use symbols in case? oO
<Profpatsch> https://bigmac.caelum.uberspace.de/paste/%252AGeiser%2520dbg%252A.html
<bipt>Profpatsch, you don't need to quote the keys
<Profpatsch>Oh, I see. Hm, the Guile docs don’t say anything about them not having to be quoted.
<Profpatsch>R5RS does list examples that would have shown me.
<Profpatsch>Examples rule.
<Profpatsch>Is there something like edebug for Guile in Emacs?
<mark_weaver>Profpatsch: I haven't used edebug, but type ",help debug" at the REPL for some debugging commands. also ",help profile" (,trace in particular)
<mark_weaver>also see section 4.4.6 of the manual
<mark_weaver> http://www.gnu.org/software/guile/manual/html_node/Interactive-Debugging.html
<mark_weaver>there has been some work to integrate this with GUD, but it's a work-in-progress
***aksatac___ is now known as aksatac
<nalaginrut>morning guilers~
<paroneayea>Profpatsch: I've asked the same things, quite recently actually!
<paroneayea>there's nothing quite similar to edebug at present, though guile has some excellent debugging tools (see ,trace for example)
<paroneayea>in the future, mark_weaver thinks he might implement something along the lines of racket's macro steppers, I think, which might get us closer to there
<paroneayea>that, anyway, is what I seem to remember :)
<tadni>Does wingo speak fluent French?
<rlb>has the byte-compiled file permissions issue been addressed yet?
<rlb> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758971
<civodul>Hello Guilers!
<mark_weaver>rlb: not yet, sorry
<mark_weaver>hi civodul!
<civodul>hi mark_weaver!
*mark_weaver is merging stable-2.0 into master
<mark_weaver>first time since april
<civodul>ouch, this long?
<mark_weaver>yep
<mark_weaver>I've been changing copyright notices to use ranges whenever there are at least three years in a row. so far, I've only come across one file that I could write 1995-2014 for: numbers.c
<civodul>heh :-)
<civodul>the other files need love, i guess
<mark_weaver>civodul: btw, I've noticed that gitweb is _far_ superior to cgit for looking at merges.
*mark_weaver just pushed the stable-2.0 merge into master
<civodul>still not as good as magit, no? ;-)
<mark_weaver>about the same, I think.
<mark_weaver>but maybe I'm missing something
<mark_weaver>also gitweb renders properly in emacs-w3m, whereas cgit is virtually unreadable (all indentation is lost, so all lines are lined up on left edge)
<mark_weaver>probably the same in w3m, but I haven't checked
<mark_weaver>actually, I think gitweb's presentation of merges is arguably superior magit's because by default it omits "simple merges"
<civodul>oh, ok
<civodul>BTW, seems there are no libgit2 bindings out there, are there?
<mark_weaver>I've not heard of any
<mark_weaver>anyway, time for me to sleep.
*mark_weaver --> zzz
<civodul>night!
<Ulrar>I have problems with guile-curl, i'd like to try with guile-gnutls. Are there any good example of how to use it ?
<civodul>Ulrar: i think guile-curl can do several protocols beside HTTP, whereas Guile's (web client) is HTTP-only, obviously
<civodul>as for GnuTLS, there are examples in its manual
<civodul>guile-gnutls.info, that is
<Ulrar>yeah, I'm trying to do https
<civodul>for https, see http://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/download.scm#n115
<Ulrar>Thanks
<ft>Hm. There is no way to inspect the value of errno with guile, is there? I've got this module that makes some POSIX calls available via the dynamic FFI, and errno is kind of needed to provide proper diagnostics.
<ft>I am doing something along these lines: (car (parse-c-struct (dynamic-pointer "errno" libc) (list int32)))
<ft>But that doesn't work too well with systems that do tricks with errno, like "#define errno (*__errno())" to support per-thread errno values.
<ft>And then there is the issue with what's happening with the runtime runs a posix function in between my call and my retrieving the errno value. I guess I'm screwed even if I can access it.
<civodul>ft: http://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/syscalls.scm#n54
<civodul>don't try this at home ;-)
<civodul>and this is glibc-specific, of course
<ft>civodul: Yeah. But doesn't that suffer from possible race conditions as well, should the runtime decide to run another function that touches errno in between?
<civodul>ft: there's a risk, but in practice it's worked well
<civodul>it should use call-with-blocked-asyncs to be safe, actually
*ft looks at what call-with-blocked-asyncs is...
<ft>Ah. Okay.
<dsmith-work>Morning Greetings, Guilers
<ft>civodul: call-with-blocked-asyncs seems to make things work for me. Thanks for mentioning! :)
<civodul>ft: did you have actual problems getting errno without it?
<ft>civodul: I was constantly getting errno := 0, eventhough I deliberately forced errors.
<civodul>with the code i posted or with a different variant?
<ft>civodul: My code is a bit different: https://github.com/ft/guile-termios/blob/master/scheme/termios.scm#L58
<mark_weaver>we should really add a portable way to access 'errno' to our FFI.
<mark_weaver>ft: would you like to mail bug-guile@gnu.org about it, so that we won't forget?
<ft>mark_weaver: I can do that this evening
<mark_weaver>okay, no rush, just as long as we don't forget :)
<ft>ok :)
<paroneayea>okay
<paroneayea>I got automake working enough by cargo culting from sly. I don't totally understand why it works.
<paroneayea>btw, now that guile extensions work in make, I wonder if anyone is using them?
<mark_weaver>if anyone is using what?
<paroneayea>it might be interesting if someone took advantage of that to auto-build a lot of the standard gnu targets, but through guile make integration
<paroneayea>the guile scripting of makefiles
<paroneayea> https://www.gnu.org/software/make/manual/html_node/Guile-Integration.html
<paroneayea> https://www.gnu.org/software/make/manual/html_node/Guile-Interface.html#Guile-Interface maybe someone could write something that uses gmk-expand to build "make install", blah blah standard gnu targets
<rlb>mark_weaver: np -- just wanted to check.
<paroneayea>I might understand that more than automake :)
<civodul>GNU Make support for Guile is too limited IMO
<paroneayea>civodul: oh?
<paroneayea>it looks like it doesn't have access to the makefile's data
<paroneayea>that seems like the big downside to me
<ft>civodul: btw. Doesn't ‘dynamic-func’ throw an exception if "__errno_location" couldn't be found? The code around line 54 reads like it expects it to return #f in that case.
<civodul>ft: oh you're right
<rlb>it'd be nice to have an extremely portable, but higher-level build system -- in the past I wondered if something like python could become that, but I'd be fine with guile too ;>
<civodul>there was Conjure, back in the day
<civodul>by jao et al., IIRC
<civodul> http://home.gna.org/conjure/
<civodul>then one could also use Guix for that
<taylanub>I just saw someone use <foo> (angle brackets) for pattern variables in syntax-rules. I quite like the idea. is anyone following such a convention, or would it be annoying if I did it?
<mark_weaver>usually angle brackets are for class names.
<davexunit>that would confuse me.
<mark_weaver>a more established (older) convention for pattern variables is to start them with a '?'
<mark_weaver>if you want to mark them, I would suggest that instead. although I'm not sure they need marking.
<taylanub>hm, guess I'll just drop the idea. I find <foo> quite neat because one also often uses that as grammatical placeholders like in the descriptions of syntax, but I'll live without it for the sake of convention
<dsmith-work>taylanub: Another pattern convention I've seen is to use "*" in variables before "...", like "foo* ...". Like a regex. Keeps you mindful of zero-or-more.
<dsmith-work>Woah. conjure. Forgot all about that.
<taylanub>yeah, I use 'foo foo* ...' often
<dsmith-work>Hmm. Are { } legal in identifiers?
<mark_weaver>dsmith-work: please avoid them. they are reserved in the scheme standards, and used by SRFI-105 (curly infix) and SRFI-110.
<dsmith-work>Reserved for future use..
<mark_weaver>right
<dsmith-work>Ah, curly infix. Right.
<dsmith-work>"Nevermind".
<rlb>Not sure yet that this has any upstream implications, but I'll need to fix it for debian soon: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759096
<civodul>Guile was built with a compiler that was removed in the meantime, making its default CPP invalid
<rlb>right
<civodul>what could Guile do to avoid that?
<rlb>not sure -- don't know the details well enough yet -- i.e. on debian could it just use "gcc"?
<rlb>instead of "ARCH-gcc"?
<rlb>dunno
<rlb>perhaos not
<rlb>in any case, the right fix may just be for me to upload a new version (so no big deal)
<mark_weaver>rlb: can you set CPP?
<civodul>heh, ok
<mark_weaver>guile-snarf uses that if it's set
<rlb>mark_weaver: want the defaults on debian to be correct, and match "normal" upstream behavior, so unless it was a conditional CPP setting (when unset), might not want to do that.
<mark_weaver>okay. it's just not clear to me what's the right fix here, but I'm open to suggestions!
<rlb>in any case, may be nothing to see here -- just thought I'd point it out in case there were any strong opinions about how it should be handled.
<mark_weaver>okay, thanks for the heads up!
<civodul>speaking of which, the manual of the GnuTLS bindings finally made it on gnutls.org: http://gnutls.org/documentation.html
<mark_weaver>that's good :)
<ft>Huh. (strerror '(0)) seems to deadlock guile. - Yes, '(0) isn't a useful value to put into ‘strerror’, but still. :)
<ft>When you run it in gdb and Ctrl-c it, the backtrace shows __ll_lock_wait(), _L_lock_926(), __pthread_mutex_lock() on top of the callstack.
<mark_weaver>ft: ah yes, we already have a ticket for that one: http://bugs.gnu.org/18065
<ft>mark_weaver: Ah. :)
<mark_weaver>there's a patch included, but I don't yet understand why it's needed. I'd like to understand what's going on before pushing a fix.
<ft>mark_weaver: Indeed.
<mark_weaver>ijp guessed that maybe the pre-unwind handler tries to lock the same mutex.
<ft>Possibly.
<ft>mark_weaver: Because in gdb, I see "Backtrace:\\n" before it locks down.
<paroneayea>davexunit: what's the provenance on guile.am from sly? I see it in a few packages, but none of them copyright info
<paroneayea>it doesn't seem to come from guile master
*davexunit scratches head
<paroneayea>but none of them have copyright info, I mean
<davexunit>I think I stole that from guile-opengl
<paroneayea>okay, cool.
<paroneayea>hm, GPLv3 or LGPLv3 for this deployment thing
<paroneayea>I guess GPLv3.
<davexunit>I would lean towards GPLv3
<paroneayea>rage against the devops machine
<davexunit>does the world need one more lax licensed devops tool? go-go gadget copyleft.
<paroneayea>yeah :)