IRC channel logs

2013-04-17.log

back to list of logs

<DerGuteMoritz> http://www.r6rs.org/steering-committee/election/nominees.html is quite interesting, too
<DerGuteMoritz>ok now I'm off to bed :-) good night!
<dsmith-work>Any news yet on who or why the bombing?
<davexunit>I haven't heard any
<mark_weaver>nor have I
<mark_weaver>apparently at least one of the bombs was made from a pressure cooker packed with shards of metal, nails, and ball bearings.
<mark_weaver> https://en.wikipedia.org/wiki/Boston_Marathon_Bombing
<davexunit>jesus
<ArneBab_>When trying to run the webserver example, I get an error: web/server/http.scm:58:0: In procedure module-lookup: Unbound variable: AF_INET
<ArneBab_>Example: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=examples/web/hello.scm;h=aa383c5897fa71766a27e5c921bfc895948cf8b8;hb=HEAD
<ArneBab_>(if you answer, please mention my name: I normally read my backlog)
<dsmith-work>ArneBab_: With guile 2.0.9, works-for-me
<dsmith-work>ArneBab_: What version of guile? What platform?
<ArneBab_>I have 2.0.7, Gentoo GNU/Linux
<dsmith-work>What happens if you fire up a guile and eval AF_INET ?
<dsmith-work>scheme@(guile-user)> AF_INET
<dsmith-work>$1 = 2
<dsmith-work>
<dsmith-work>I wonder if that guile was ./configure'ed --disable-networking
<ArneBab_> AF_INET
<ArneBab_>ERROR: In procedure #<procedure ce21a0 ()>:
<ArneBab_>ERROR: In procedure module-lookup: Unbound variable: AF_INET
<ArneBab_>dsmith-work: that’s easy to check…
<ArneBab_>dsmith-work: damn… yes it is.
<ArneBab_>dsmith-work: thanks!
<ArneBab_>besides: should I configer it with threads?
<dsmith-work>Threads should be fine. I think the only people with threads issues are mingw or bsd or something.
<ArneBab_>ah, ok
<dsmith-work>ArneBab_: What's your libgc ? The have been issues that go away with 7.2d
<dsmith-work>istr that being thread releted somehow... not sure.
<ArneBab_>2.15-r3
<dsmith-work>libgc
<dsmith-work>The garbage collector library
<ArneBab_>does it have another name?
<ArneBab_>(I mistook it for glibc…)
<dsmith-work>sneek: libgc?
<sneek>Someone once said libgc is http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2d.tar.gz
<dsmith-work>That
<ArneBab_>ah, yes: boehm-gc: 7.2d
<dsmith-work>Cool
<mark_weaver>ArneBab_: interesting. any idea why it was built with --disable-networking? is that how it's built by default on gentoo?
<ArneBab_>I think that is likely the default: In Gentoo the user gives the USE flags he or she needs. The base system tries to stay minimal
<mark_weaver>it seems kind of extreme for a modern scripting language to be built without networking support. is python built without networking by default?
<mark_weaver>well, I regret using the word "scripting" there.
<ArneBab_>actually guile 2.0.7 is still hardmasked…
<mark_weaver>what does "hardmasked" mean?
*dsmith-work has suspicions
<mark_weaver>I find this really obnoxious. As if Guile didn't already have enough of an uphill battle, Gentoo builds us with one leg cut off.
<ArneBab_>that means “don’t use it, if you’re not willing to fix breakage”
<mark_weaver>networking is an extremely important thing for a language to support in today's world.
<mark_weaver>I want to know who was responsible for this.
<ArneBab_>or rather: https://bugs.gentoo.org/show_bug.cgi?id=432526
<Nafai>\\\\
<ArneBab_>I think the simple reason is that “networking” is not in a default profile (as most packages don’t even have a switch for it)
<Nafai>Whoops, sorry
<ArneBab_>there is exactly one package in the whole tree which uses the useflag networking and that’s guile.
<ArneBab_>it should be a trivial fix, though
<ArneBab_>mark_weaver: https://bugs.gentoo.org/show_bug.cgi?id=466174
<ArneBab_>request to add networking
<mark_weaver>ArneBab_: thank you!
*ArneBab_ needs to go to bed - it’s 01:37 over here…
<ArneBab_>mark_weaver: for the packagers that’s actually a 1-character fix: Just add a + in front of the useflag :)
<mark_weaver>okay, good night!
<ArneBab_>cu, and many thanks for working on guile!
<mark_weaver>thanks for bringing this issue to our attention, and for filing the bug report :)
<ArneBab_>:)
<ArneBab_>I actually hit it when I played with my wisp indentation-to-brackets preprocessor :)
***fangism is now known as fangism-hungry
<nalaginrut>morning guilers~
<mark_weaver>hi nalaginrut!
<adu_>hi mark
***adu_ is now known as adu
<mark_weaver>hi adu!
<adu>how goes guile?
<mark_weaver>pretty well, I think. we seem to be picking up momentum lately :)
<mark_weaver> https://www.ohloh.net/p/guile
<adu>nice, anything I can do to help?
<adu>I've been puting the finishing touches on my compiler, and now I have no libraries, and the thought of writing lots of libraries scares me
<mark_weaver>it's hard to pick jobs for other people, but there's certainly lots to do.
<adu>and btw, my compiler is written in guile :)
<mark_weaver>excellent :)
<mark_weaver>here's a list of tasks that I wrote up a while ago: https://lists.gnu.org/archive/html/guile-devel/2012-03/msg00076.html
<adu>did I ever show it to you?
<adu>* VM instruction to lisp canonicalize (#f or '() => #nil) ?
<mark_weaver>I think you showed me an early version of it. I seem to have forgotten the details.
<adu> https://github.com/andydude/droscheme/tree/andrew-working/scm
<mark_weaver>yes, as I recall, I noticed that the guile-emacs project could make use of such a VM instruction, though I've forgotten the details of that too :)
*mark_weaver looks at droscheme again
<adu>probably the best page is http://andydude.github.io/droscheme/cmd/
<mark_weaver>oh right, this compiles to Go.
<adu>especially the "it's not working yet"
<adu>the compiler is working great
<mark_weaver>now I remember...
<adu>but until I figure out how to make the interpreted and compiled languages the same, I'm a bit stalled
<mark_weaver>how did you handle tail recursion?
<adu>by requiring gccgo
<adu>I know its lame
<mark_weaver>I don't understand how that helps. Does gccgo guarantee that tail calls will be optimized into gotos for all the code that you produce?
<adu>yes
<mark_weaver>really? very interesting. for C code at least, gcc tries to do the optimization, but in practice you can't count on it except in very simple cases.
<adu>oh, then I was misinformed
<mark_weaver>did you have to make a big compromise in your generated code to make that possible?
<adu>no
<mark_weaver>there was an academic article written on this topic. let me see if I can find it.
<adu>cool, I'm certainly interested
<mark_weaver> https://lists.gnu.org/archive/html/guile-devel/2011-04/msg00055.html
<adu>can you show me an example of C code that is tail-recursive that gcc doesn't optimize?
<mark_weaver>actually, it was a thesis.
<adu>oh
<mark_weaver>lots of people have wanted this for a long time, most notably people who write compilers for functional languages targetting gcc as a back end.
<mark_weaver>granted, that thesis looked at GCC circa 2003, but if it had changed, I think it would have been big news in this community.
<adu>I've read a lot of ASM produced by gcc, and every tail call I've seen has been a goto
<adu>oooo http://community.schemewiki.org/?gcc-does-no-flow-analysis
<adu>alloca() would screw up things
<adu>hahaha, that article should have been called "uses of unary & foil tail-call optimization"
<mark_weaver>well, gcc fails to do TCO for this code on Sparc and ARM at least: http://codepad.org/9hGa7RLI
<mark_weaver>I suspect there are simpler cases that fail as well, but I don't have much time to spend on this right now.
<adu>ok
<mark_weaver>and gcc fails to do TCO on this code on x86_64: http://codepad.org/hEdr1iDk
<adu>do you have time for another thesis?
<adu> http://web.mit.edu/~axch/www/
<mark_weaver>propagators? yeah, I know about them. very exciting work.
<cky>mark_weaver: I'm staring at the SRFI 41 code again. In stream-match, in the make-matcher procedure, I'm thinking of changing the (var . rest) case's match clause to use stream-pair? instead of (negate stream-null?). Comments?
<mark_weaver>adu: your 'string-escape' procedure doesn't work properly.
<adu>that was a hack, I'm welcome to suggestions
<cky>mark_weaver: Originally I used (negate stream-null?) to complement the stream-null? case with the () match clause, but, stream-car and stream-cdr (as used in the (var . rest) match clause) won't ever work with anything that isn't stream-pair?, so this expresses the intent more directly. I think.
<mark_weaver>cky: yeah, I think you're almost certainly right, but I'd like to fully grok this code before I comment further.
<mark_weaver>cky: I think I'd like to completely rewrite 'stream-match' to generate better code.
<mark_weaver>cky: well, for now, I definitely agree that changing (negate stream-null?) to stream-pair? would be a significant improvement.
<mark_weaver>the reason I say "significant" is because using 'negate' is (unfortunately) very inefficient.
<cky>mark_weaver: Please do feel free to refactor stream-match as you please. I just did the simplest thing I could think of that actually made use of (ice-9 match) (rather than the home-grown matcher in the reference implementation).
<mark_weaver>don't get me wrong, what you wrote is perfectly reasonable, and the code isn't bad.
<mark_weaver>but look at ,optimize (stream-match strm ((a . b) (list a b)))
<cky>I will, once I build Guile 2.0.9. (I know, still not gotten around to it. I wanted to upgrade to a libgc 7.2d deb on my Squeeze system first, but that turned out to be too much work---the only 7.2d deb was from Ubuntu, and it requires multiarch (which Squeeze doesn't have).)
<mark_weaver>there are four type checks on a single item: one at the beginning, one in the 'stream-pair?', and then two more in 'stream-car' and 'stream-cdr'.
<cky>Yeah.
<mark_weaver>I'll put it on my todo list :)
<cky>:-D
<mark_weaver>adu: a simple solution is to use 'string->list' to create a list of characters, then 'map' to map each of those to a string, and then pass the resulting list to 'string-concatenate'.
<adu>mark_weaver: ok, I'll try that
<mark_weaver>'string-concatenate' is very well implemented in Guile, btw.
<cky>Yes, and much more readable than ''.join(...). ;-) (That's the standard way to concatenate a sequence of strings in Python that doesn't exhibit O(n^2) runtime.)
<mark_weaver>heh
<cky>(More seriously, we have a lot of Java code at work, and I cringe whenever I see string += being used in a loop.)
<mark_weaver>cky: I forgot to respond to your mention of racketcon, but yeah, if you're going to be in the area, it would be great to meet you :)
<cky>mark_weaver: Oh cool. :-)
<mark_weaver>yeah, the code for string-join before 2.0.9 make that same mistake, and the results were rather disastrous for large lists.
<cky>:'(
<mark_weaver>do you hope to present at racketcon this year?
<mark_weaver>(I know you did last year)
<adu>good night
<cky>Yes, I hope to actually have Rackona fully fleshed-out by then. :-)
<cky>The Rackona I presented was what I had hacked together in 2 days.
<cky>...which was all the time I could put towards it, at the time.
<mark_weaver>how hard do you think it would be to adapt Rackona to work on Guile?
<cky>It shouldn't be hard, but I haven't tried yet. :-)
<cky>Obviously, we'll have to find another coffee-related name that relates to Guile. :-)
<mark_weaver>hehe
<mark_weaver>I think it would be a great addition to Guile.
<cky>Yeah. :-)
<mark_weaver>cky: you are now prominently mentioned on <https://www.ohloh.net/p/guile>, but unfortunately your name is too long, so they show you as ".... Jester-Young", heh.
<mark_weaver>well, on the main page anyway. elsewhere your full name is shown.
<cky>Oh dear. Hehehe.
<mark_weaver>it's nice to see the graphs showing a prominent upward trend after our mid-2012 lull.
<cky>Yes, let's hope the trend continues. :-)
<cky>(I linked my Guile contributor profile to my main Ohloh profile now. Yay!)
<mark_weaver>ah, good!
<mark_weaver>You don't see pictures like this every day (warning, extremely gruesome): http://bloximages.newyork1.vip.townnews.com/thehour.com/content/tncms/assets/v3/editorial/7/28/728801c0-a6bd-11e2-9096-0019bb30f31a/516d8e417f320.image.jpg
<cky>Holy shit.
<mark_weaver>the man in the cowboy hat is actually holding on to the man's femoral artery, pinching it to prevent blood loss.
<cky>Yeah, poor guy looked like he lost enough blood already.
<mark_weaver>The man in the cowboy hat has his own interesting story. He lost both of his sons. One in the Iraq war, and the other committed suicide about a year and a half ago. http://www.dailymail.co.uk/news/article-2309762/Boston-Marathon-bomb-explosions-How-hero-Carlos-Arredondo-lost-soldier-son-Iraq-saved-lives.html
<mark_weaver>anyway, time for me to get some sleep.
*mark_weaver --> zzz
<sw2wolf>.zZ
<sneek>Welcome back sw2wolf, you have 1 message.
<sneek>sw2wolf, mark_weaver says: apparently stable-2.0 can now be built with threads on freebsd :)
<sw2wolf>where is guile statble-2.0 ?
<waxysubs`>guile-2.0.9 is out now. You can use that.
<sw2wolf>ok
<jmd>I keep getting this warning:
<jmd>WARNING: (guile-user): imported module (srfi srfi-19) overrides core binding `current-time'
<cky>jmd: What version of Guile are you using? This message shouldn't appear.
<wingo>i think he's still on 1.8 for some reason
<jmd>1.8.7
<jmd>What is the easiest way to write a procedure to generate a string which is a copy of an input string, but with all instances of X replaced by Y
<DerGuteMoritz>jmd: you mean without using a library function?
<DerGuteMoritz>are X and Y chars or substrings?
<DerGuteMoritz>-sub
<jmd>chars
<lloda>with chars, string-map
<DerGuteMoritz>+1
<jmd>thanks. I didn't know about string-map
<wingo>there is also string-replace, which is documetned in the manual.
<DerGuteMoritz>but that's cheating!
<ijp>morning
<nalaginrut>evening~
<lloda>noon
<add^_>(not night)
<add^_>:-P
<civodul>Hello Guilers!
<ijp>afternoon
*civodul shamelessly adds Guix to http://gnu.org/s/guile/gnu-guile-projects.html
<civodul>i'm sure there are many more projects that could be listed there
<civodul>maybe it's not a medium people find interesting?
<civodul>figl, guile-json, pfds, guildhall, etc.
<add^_>Yay, The Reasoned Schemer just arrived! :-D
<civodul>add^_: it's one of the two CS books i ever bought, and i enjoyed it
<civodul>(the other one is about C++ programming ;-))
<add^_>:-)
<add^_>Awesome
<add^_>If you liked it, I'm pretty sure it's good :-)
<civodul>and then you can grab minikanren from guildhall to practice
<add^_>Aah, good idea
<ijp>I worked through a couple of chapters of it on paper first
<ijp>except for the few occasions where they ask you a question you can't possibly know the answer to, it worked quite well
<add^_>:-)
<ijp>hmm, psyntax has taken a suspiciously long time
<add^_>ijp: Really? How long does it have to be before it's suspicious?
<add^_>Pretty long I suppose
<ijp>half an hour
<ijp>well, closer to 3/4
<add^_>Isn't that normal?
<add^_>Hm
<add^_>Maybe not no
***ijp` is now known as ijp
<dsmith-work>It can be *quite* a long time. Depends on the machine.
<ijp>well, it was past the 90 minute mark when I killed it
<ijp>and it's not like this is my first time compiling psyntax, I know roughly how long it should take on this computer
<dsmith-work>ok
<dsmith-work>ijp: Are you building master?
<ijp>yes
<dsmith-work>Might want to clean. Or even git clean.
<dsmith-work>master doesn't always have the dependencies right.
<ijp>I did
<ijp>anyway, I'm leaving it for now
<dsmith-work>Ok. I've had builds run for a *long* time, that went fine after a clean.
<dsmith-work>Usually when wingo is messing with the vm.
<dsmith-work>ijp: Was it chewing cpu, or sitting idle?
<ijp>just sitting idle
***serhart1 is now known as serhart
<mark_weaver>ijp: I'm doing a clean rebuild of master to see if I can reproduce the problem you're seeing.
<mark_weaver>ijp: my clean compile has already gotten past psyntax.
<mark_weaver>(I did ./autogen.sh && ./configure && make)
<wingo>i have experienced that problem as well
<wingo>it is intermittent
<wingo>seems to go away if i simply retry the build. terrible.
<mark_weaver>wingo, ijp: what version of GC are you using?
***fangism-hungry is now known as fangism
<davexunit>mark_weaver: there appears to have been an arrest made related to the bombings.
<mark_weaver>davexunit: interesting. do you have a link with more info?
<davexunit>apologies for linking to gawker, but I'm still looking for other sources: http://gawker.com/5994895?utm_campaign=socialflow_gawker_twitter&utm_source=gawker_twitter&utm_medium=socialflow
<davexunit>I'm following a twitter feed with a lot of people reporting similar things
<davexunit>I guess CNN has reported about it as well.
<davexunit> http://www.cnn.com/2013/04/17/us/boston-blasts/index.html?hpt=hp_t1
<davexunit>there.
<mark_weaver>For those who want to see the uncensored results of this bombing (warning, extremely gruesome): http://bloximages.newyork1.vip.townnews.com/thehour.com/content/tncms/assets/v3/editorial/7/28/728801c0-a6bd-11e2-9096-0019bb30f31a/516d8e417f320.image.jpg
*mark_weaver wonders if people saw uncensored images such as this more often, if they would be more opposed to the rather frequent use of US bombs elsewhere.
<mark_weaver>thanks for the links, davexunit
<dsmith-work>civodul: What was the sizes that sendfile() stopped at, if you remember?
<davexunit>mark_weaver: yeah those images, especially the man with the missing legs, are hard to look at.
<mark_weaver>dsmith-work: there's more information here: http://bugs.debian.org/629994
<mark_weaver>apparently, even for normal files, linux always seems to stop at 0x7FFFF000 bytes
<mark_weaver>(on a 64-bit system)
<mark_weaver>read(2) cuts off at that size as well.
<ijp>well, it built on the third attempt, anyway
<ijp>I've previously had trouble with threads.test on master, but I don't think this is related
<dsmith-work>that's one page (4k) less than max positive 32bit int.
<dsmith-work>Iiiinnnteresting.
<dsmith-work>mark_weaver: Oh, and internally, sendfile sets up a pipe and runs splices to/from that pipe.
<mark_weaver>apparently that limit is imposed in the upper layers in case there are bugs in the lower layers.
<mark_weaver>(e.g. block devices and filesystems)
<shizzy0>Hi guilers
<dsmith-work>shizzy0: Hey hey
<shizzy0>Has anyone done or worked with the google summer of code thing?
<shizzy0>I'm thinking about proposing a project that uses guile.
<dsmith-work>Yeah, there have been GsoC projects in the past.
<dsmith-work>bipt worked on putting guile in emacs
<shizzy0>Cool. Who was his mentor?
<dsmith-work>wingo I think
<shizzy0>Nice.
<shizzy0>Good to hear. I shot wingo an email asking if he might be interested.
<shizzy0>I'm thinking about proposing the Emacsy thing again. http://kck.st/IY0Bau
<shizzy0>Any guilers interested in possibly mentoring I'd be happy to hear from.
<wingo>oh hi shizzy0 :)
<wingo>i was just about to respond
<wingo>but as the delay indicates, i think i'm in general a terrible mentor -- not very responsive :P
<wingo>and i don't see that changing in the next few months unfortunately
<wingo>i could help in some adjunct capacity but unfortunately i'm not able to offer the kind of time you would deserve
<shizzy0>Totally understand. It's always difficult to find time.
<wingo>yeah, really sorry about that
<shizzy0>No worries. But if you do have someone else you might recommend as a mentor, I'd be happy to hear it.
<wingo>if you can convince civodul or mark_weaver, they would be ideal; also bipt, a former SoC student that worked on emacs stuff, if bipt has time
<shizzy0>I'm doing my Ph.D., I'm 33, so I don't think I'd require a lot of hand holding, but there are a few technical challenges that'd be fun to sort through.
<wingo>there are a number of other project members that could also do it; just look down the git log to see someone's work
<wingo>ah that's good to know
<shizzy0>cool.
***davexuni` is now known as davexunit
*wingo reads more
<shizzy0>Awesome. I'll follow up with them. Thanks again for all your work on GNU Guile! I've been working with it and I've been pretty amazed with what it can do.
<wingo>glad you are having fun, and see you around :-)
<shizzy0>For sure. :)
<civodul>dsmith-work: 64k
<civodul>shizzy0: did you post a proposal?
<shizzy0>civodul: not yet. I wanted to ask around about possible mentors first.
<civodul>aah, ok
<civodul>i've never mentored, but that might be doable
<civodul>we'll see with mark_weaver
<wingo>shizzy0: if you can't find anyone else, i would be willing to do it -- but with the understanding that my availability is a bit spotty. best if you could find someone else in addition.
<shizzy0>civodul: I do have a proposal though already in the form of a failed kickstarter page if you're interested: http://kck.st/IY0Bau
<dsmith-work>civodul: 64k? That's actually exactly what I expected.
<shizzy0>civodul: yeah, totally understandable. And thanks!
<mark_weaver>I don't think I want to be an official mentor, but I'd be willing to help answer any questions you might have.
<civodul>dsmith-work: well, it's a power of two :-)
<mark_weaver>it's an interesting project.
<civodul>shizzy0: ah yes, i did read about it back then
<cordawyn>hello!
<dsmith-work>civodul: It uses pipe buffers, which are 16 pages. Pages are usually 4k.
<shizzy0>mark_weaver: thanks. :)
<cordawyn>is there a way to re-export bindings from another module without having to list them all over again?
<cordawyn>(when defining a module)
<civodul>dsmith-work: ah ok, makes sense
<civodul>cordawyn: there's an undocumented API, with module-for-each, module-export!, etc.
<civodul>in boot-9.scm
<mark_weaver>shizzy0: no problem! I try to help most people anyway :)
<cordawyn>civodul: undocumented... hmm ;-)
<cordawyn>not that I can't read the source, but how stable is that undocumented API?
<mark_weaver>IMO, I would avoid that low-level module stuff.
<shizzy0>I figure, I need one official mentor for GSoC, but the true burden will be on #guile.
<civodul>i should say it's community-documented
<civodul>because Guilers have known it for decades
<civodul>:-)
<wingo>mark_weaver: why is that?
<cordawyn>oh
<wingo>that api used to have a comment above it saying "this api is unstable"
<wingo>that comment was there for 15 years :P
<dsmith-work>heh
<civodul>i do avoid it too, because the declarative approach is more amenable to Good Things
<wingo>it said "this is unstable and will change soon", what's more :P
<civodul>:-)
<cordawyn>civodul: so it's likely to stay there? I don't want to use undocumented API all over the project just to find it gone one morning :)
<mark_weaver>wingo: well, if we tell people they can safely use that api, then it constains us in the future.
<wingo>cordawyn: clearly the solution is to submit a patch documenting that api ;)
<shizzy0>lol
<mark_weaver>wingo: also, the problem texinfo is having with Guile 2.0 seems to be largely due to them using too many low-level module interfaces.
<wingo>mark_weaver: true, but personally i've gone through it quite a bit and it seems fine to me
<cordawyn>wingo: I wouldn't mind making a patch, really. Just wanted to make sure it's not something experimental (and undocumented because of that)
<civodul>cordawyn: it's here to stay, i think
<wingo>so many opinions :-)
<civodul>what is "the problem texinfo is having with Guile 2.0"?
<wingo>i agree that a doc patch will clarify things for good
<civodul>yep
<wingo>we can argue over the interface then commit to something
<mark_weaver>IMO, it's better to use declarative interfaces than imperative ones, especially for something like a module system, especially if the only reason is to save the programmer from writing out a list of bindings.
<wingo>mark_weaver: no argument there!
<civodul>yeah
<mark_weaver>if it's deemed useful to reexport the entire interface from another module, maybe we should just add that feature to the 'define-module' API?
<wingo>or add a re-export-module form
<mark_weaver>right, something like that.
<wingo>and/or, really...
<wingo>anyway, agreed, but sometimes it's good to muck around in modules, and having a documented interface for that would be a good thing
<wingo>while preferring higher-level interfaces of course
<shizzy0>One vote for re-export-module. I wrote a procedure to do a similar operation.
<wingo>shizzy0: i think i've written that one on quite a number of occasions ;)
<cordawyn>shizzy0: +1 :)
<wingo>fwiw, it's (module-use! (module-public-interface (current-module)) (resolve-interface other-module-name))
<cordawyn>ok, thanks for the help, guys. I'm back to the grind.
<mark_weaver>civodul: sorry, I meant to say "the problem texmacs is having with guile 2.0"
<civodul>aah, ok
<cky>Oh look, it's a bipt. :-)
<civodul>bipt: what's up with Emacs? :-)
<cordawyn>mark_weaver: IMHO, it makes sense to add #:re-export-module feature to define-module :)
<wingo>bipt pounce
<ijp>I don't see how a re-export-module would be very helpful in general unless you also had a way to filter that list
<wingo>let's say you have a scheme module that binds some library
<wingo>there are types and functions
<wingo>you want to export everything
<wingo>but you have to implement the functions in terms of the types
<wingo>so you have separate modules and re-export the types module
<wingo>that's a pretty classic case IME
<wingo>that said it has also been the case for me that sometimes my use of re-export-module has corresponded to sloppy API thinking
<cordawyn>btw, doesn't "require" from SLIB automatically re-export bindings from the "require"d module?
<cordawyn>ok, never mind
<cordawyn>oh, another question, if I may :)
<cordawyn>s48-interfaces.scm here defines one "rdf-graph" interfaces, while the library has 2 modules with different graph implementations (and identical API).
<cordawyn>So one can choose one of the implementations in his/her own project.
<cordawyn>How does Guile handle such cases?
<cordawyn>...one "rdf-graph" *interface...
<cordawyn>just load the main module with interface definition, then load one of the submodules?
<cordawyn>something like:
<cordawyn>(use-modules (main) (main rdf-graph-1))
<cordawyn>or
<cordawyn>(use-modules (main) (main rdf-graph-2))
<cordawyn>I'm pretty sure that "main" will complain that there's "no code for (main rdf-graph-*)" :-)
<cordawyn>that is, for "(main rdf-graph)"
<mark_weaver>sounds like you want higher-order modules, which we don't yet support.. but ijp did some work on that.
<mark_weaver> https://lists.gnu.org/archive/html/guile-user/2012-03/msg00018.html
<cordawyn>I seem to tread upon "problematic" cases every time I dig deeper ;-)
<wingo>:)
<cordawyn>must be my inexperience ;o)
<mark_weaver>though scheme doesn't really have "interface definitions", does it?
<cordawyn>I'm porting that lib from Scheme48
<mark_weaver>so I may have misunderstood.
<ijp>the reason I never finished that was because I wasn't quite sure of how the module system worked at the time
<mark_weaver>I've never really studied Scheme 48's module system, but apparently it is based on ML's module system, which as I recall supports higher-order modules.
<cordawyn>mark_weaver: it's close to the case described in that message, right. But not precisely like that.
<cordawyn>to put bluntly, "main" exports function "x", but there's no code for it in "main"
<cordawyn>rdf-graph-1 defines "x" and exports it
<cordawyn>rdf-graph-2 does the same as rdf-graph-1
<cordawyn>no
<mark_weaver>does main use x, or just export it?
<cordawyn>they do not export
<cordawyn>main just exports it
<cordawyn>while rdf-graphs just define it, without exporting
<cordawyn>so, main combined with either of them provides a complete export + definition combo
<mark_weaver>in scheme 48, how does the user choose which rdf-graph implementation to use?
<cordawyn>I'm trying to figure that
<mark_weaver>it sounds like the easiest solution is to simply make 'rdf-graph-1' and 'rdf-graph-2' export 'x', and to remove the export from 'main'.
<cordawyn>(I'm coming from ruby and haskell land, no scheme experience whatsoever)
<mark_weaver>and then users should simply import both 'main' and 'rdf-graph-?'.
<mark_weaver>but maybe that's suboptimal, dunno.
<cordawyn>yes, this seems like an option
<mark_weaver>(main) seems like a very bad name for a module though.
<cordawyn>well, perhaps, the only option in guile
<cordawyn>it's just an example :-)
<cordawyn>the real name is "schemantic-web"
<cordawyn>semantic web stuff
<mark_weaver>well, if you use the low-level module interfaces, you can certainly do whatever you want. but it might be the only option that uses the high-level interfaces.
<mark_weaver>'use-modules' does not provide a way to pass parameters to modules that are being imported, so there's no way to specify which underlying rdf-graph implementation to use when importing 'main'.
<cordawyn>I see
<cordawyn>here's how I'm designing the lib:
<cordawyn>1) I have a "main" module which re-exports all modules (well, almost all)
<cordawyn>2) I have a module that, let's say, *doesn't* depend on anything, named "rdf"
<cordawyn>3) and I have 2 graph implementations that depend on "rdf"
<mark_weaver>the other obvious way to do this is to wrap the entire 'main' module within a procedure, where that top-level procedure accepts as argument(s) the rdf-graph procedures.
<cordawyn>oh!
<cordawyn>that sounds interesting
<mark_weaver>that top-level procedure could return another procedure that let's you access all of the inner procedures that you want to export.
<mark_weaver>*lets
<cordawyn>how common is that trick?
<mark_weaver>something like (define (make-main-module rdf-proc1 rdf-proc2 ...) [define all inner procs] (lambda (name) (case name ((inner-proc-1) inner-proc-1) ...)))
<mark_weaver>it's kind of a classical technique in the scheme world. I don't know off hand how common it is.
<cordawyn>I'd like to follow the principle of least surprise, if possible ;-)
<mark_weaver>but it shows that scheme doesn't really *need* a module system at all. the main advantage is that it allows you to put more things at top-level, which in turn makes interactive development and debugging more convenient.
<mark_weaver>better yet, instead of passing 'rdf-proc1', 'rdf-proc2' ..., just pass in the rdf-module itself, which is itself a procedure that accept a symbol and returns the associated exported procedure (just like the inner lambda in 'make-main-module' above)
<mark_weaver>this is one way of making a module system out of closures.
<cordawyn>uh, let me copy it all into my notebook :)
<cordawyn>mark_weaver: thanks a lot for your help! I'm off to give it a good thinking over ;)
<mark_weaver>okay, happy hacking!
<cordawyn>I think I'll go with separate graph modules for now, but will add those tricks to the todo list
<mark_weaver>given that main doesn't even use the rdf-graph modules directly, I think that makes sense here.