IRC channel logs

2014-02-13.log

back to list of logs

<madsy>Does churning #t and #f through scm_to_int32() yield 1 and 0?
<dsmith-work>madsy: I thing you will raise an exception
<dsmith-work>madsy: http://www.gnu.org/software/guile/manual/html_node/Integers.html#index-scm_005fto_005fint32
<dsmith-work>#t and #f are not exact integers
<mark_weaver>madsy: maybe you're looking for 'scm_is_true'
<mark_weaver>or alternatively 'scm_to_bool'. 'scm_to_bool' will only accept #t or #f. 'scm_is_true' will return 1 for anything that's not #f, following the Scheme convention.
<madsy>Yeah I settled for scm_to_bool
<didi>Does guile have an sexp-based regexp?
<dsmith-work>didi: Pretty sure irregex is in the guild-hall.
<dsmith-work>(the package thingy)
<didi>dsmith-work: Hum, I think I've never used it.
<didi>The "package thingy", I mean.
<dsmith-work>Me neither.
<didi>Also, what is "irregex"?
<dsmith-work> http://synthcode.com/scheme/irregex/
*didi found this srfi <http://srfi.schemers.org/srfi-115/srfi-115.html>
<dsmith-work>"This SRFI provides a library for matching strings with regular expressions described using the SRE "Scheme Regular Expression" notation first introduced by SCSH, and extended heavily by IrRegex."
<dsmith-work>So where *is* the current guildhall location?
<didi>Dunno.
<didi>People use it?
<didi>`guild' is not being too helpful. It asks me to input commands for help but doesn't seem to list them.
<dsmith-work>Yes, so I've heard
<dsmith-work>mark_weaver: Do you know?
<dsmith-work> https://github.com/ijp/guildhall/wiki/Getting-Started ?
<dsmith-work>And that points to http://shift-reset.com/doro/wak-irregex_0.8.1-2.zip
<didi>dsmith-work: Thanks. Tho then I assume there is no such thing inside guile's distribution.
<dsmith-work>Not yet.
<didi>Is anyone working on one?
<dsmith-work>I've heard rumors.
<didi>Cool.
<mark_weaver>didi: I'm going to add SRFI-115 when it's finalized.
<mark_weaver>SRFI-115 will be a standardized version of irregex.
<mark_weaver>ah, you already knew that, I see.
<didi>mark_weaver: No no, I didn't.
<didi>mark_weaver: Cool.
<didi>I'm excited to see it happening.
<didi>I <3 Emacs' rx.
<mark_weaver>yeah, sexp-based regexps are definitely the way to go.
<didi>:^D
<mark_weaver>didi: in the meantime, you can install guildhall and use irregex. there are probably some minor differences, but I doubt it would be hard to port whatever you write for irregex to use SRFI-115 when it's built in to guile.
<didi>mark_weaver: Thank you, but as I don't have a pressing need for this nor I know how to use guildhall, I'll wait for your implementation of SRFI-115.
<mark_weaver>okay.
<davexunit>mark_weaver: just tried out the REPL server with guile-2d. looks good!
<davexunit>didn't get to see the movie because there was a giant line with people that showed up hours in advance, so I went to bonchon and tested the coop repl server instead. :)
<cantstanya>Hi is this the right place to ask about dmd?
<mark_weaver>glad to hear the REPL server works :)
<mark_weaver>cantstanya: #guix is probably a better place, but the primary devs are asleep now (european time)
<cantstanya>oh okay
<mark_weaver>you could send email to guix-devel@gnu.org
<mark_weaver>davexunit: sorry you missed the movie though...
<cantstanya>thanks
***Fuuzetsu is now known as Guest63073
***Guest63073 is now known as Fuuzetsu`
***Fuuzetsu` is now known as Fuuzetsu
<nalaginrut>morning guilers~
***Fuuzetsu is now known as Guest75490
<zRecursive>wish somebody could build guile-2.0.9 for freebsd. there is only 1.8.8 in freebsd repo :(
<mark_weaver>zRecursive: someone has prepared a Guile 2 port for FreeBSD, and plans to get it upstreamed after 2.0.10 is released.
<mark_weaver>the bdw-gc package needed work as well.
<mark_weaver>the person working on it is zacts, here on channel.
<mark_weaver>at the moment he's known as zacts_
<mark_weaver>zacts_: what's the status of getting your new bdw-gc-pthreads package into freebsd?
<zRecursive>great !
***Fuuzetsu` is now known as Fuuzetsu
<zacts>mark_weaver: hey, yeah. I'm working on it. I had a bit of homework catch up with me, but I should have a devel/boehm-gc-pthreads PR ready to submit in a day or so. (don't know how long it will take to be included in the ports tree).
<zacts>but I am working with another FreeBSD ports developer on this also.
<zacts>I'm aiming for having everything imported by the timeframe you gave me for the guile-2.0.10 release
<zacts>working with both upstream FreeBSD and upstream guile which are you guys.. :-)
<zacts>devel/boehm-gc is currently a problematic unmaintained port. I'm working directly with kwm on #bsdports @ irc.efnet.org on this.
<zRecursive>wish we can `pkg install guile` soon
<zacts>zRecursive: you can help if you wish! do you have FreeBSD-10 installed?
<zacts>(even if just testing the ports in an ezjail)
<zRecursive>not yet! i have an old box with fb 9.1
<zacts>ah, that's ok. I'll try to get some patches / diffs / and shars ready tonight.
<zRecursive>it is too slow to build guile 2.0.9 on the box
<zacts>ok, yeah. I will do what I can to get my ports ready by the time guile-2.0.10 is out.
<zRecursive>good news
<zacts>zRecursive: if you like you may /msg me anytime, to be updated on progress.
<zRecursive>ok
<nalaginrut>2.0.10 is ready to pop now?
<zRecursive>What is the best way to determine whether or not "xxxxxx" is in a file with data as "****** aa bb cc\\n ******dd ee ff\\n ..." ?
<zRecursive>BTW, the data file is VERY big !
***zRecursive is now known as zRecursive{away}
<nalaginrut>zRecursive{away}: try grep (and please ask Guile relative questions)
<mark_weaver>madsy: FYI, I recently pushed changes that should enable 'lstat', 'mkstemp' and 'select' on Windows. This should enable more tests to run and hopefully fix 'sleep' and several other things. The changes are now in the latest tarball from http://hydra.nixos.org/job/gnu/guile-2-0/tarball/latest
<mark_weaver>LRN: ^^
<LRN>i see
<LRN>i don't really use guile though, so this is mostly of academic interest
<mark_weaver>LRN: out of curiosity, why were you building guile?
<LRN>well, to have it as a dependency
<mark_weaver>for what?
<mark_weaver>sorry, I don't mean to be nosy. you needn't answer, I'm just curious.
<LRN>for gnutls, i think :) And it turned out that gnutls needs popen which is removed by --disable-posix, so effectively i've got nothing out of guile. Although maybe there are other packages that use guile, i just didn't pay attention
<LRN>I know for sure that autogen (the binary) requires guile, and there are packages that use autogen
<LRN>So this is not entirely useless (unlike Ada)
<mark_weaver>heh :)
<mark_weaver>the interesting thing is that a long time ago, you sent me a build script you used to build guile on windows, and you didn't pass --disable-posix in that script.
<mark_weaver>but I think maybe you added it because things weren't working as well on windows back then.
<mark_weaver>(mainly we've benefitted from improvements in gnulib)
<LRN>yes, i think --disable-posix was a direct result of you guiding me in debugging guile hangups back in the day
<LRN>currently i don't care enough about guile to do anything about this. Maybe if guix project devs figure out how to make it W32-compatible, i'll give it a thought
<mark_weaver>guix certainly won't be targetting windows at all, but we'd like to support windows better. it seems that madsy is interested and willing to help, so maybe there will be progress now.
***zRecursive{away} is now known as zRecursive
***forgottenwizard is now known as ZombieChicken
<wingo>good morning/evening, mark_weaver :)
<mark_weaver>hi wingo!
<zacts>morning
<zacts>I think guix is a great project.
<wingo><3
<mark_weaver>zacts: did you see my message earlier about the new tarball with hopefully better windows support?
<zacts>mark_weaver: I'm skimming backlog now
<zacts>oh cool
<zacts>I can test that in a windows vm if you want
<mark_weaver>zacts: that would be helpful!
<zacts>(I currently have to use winblows for a course I'm taking "Intro to computers")
<zacts>It's required! I hate it, but oh well..
<zacts>mark_weaver: anyway, I do have an 'it works!' boehm-gc-pthreads and guile-2.0.9/guile-2.0.10 port on FreeBSD
<zacts>I'm about to email it to my ports mentoring dude.
<mark_weaver>zacts: oh, I'm sorry, I got mixed up. I meant to tell madsy about the patches, not you.
<zacts>mark_weaver: ah ok!
<mark_weaver>zacts: nevermind about the windows. don't waste your time on it.
<zacts>\\o/ - less windows usage for me
<mark_weaver>zacts: that's great about FreeBSD though :)
<mark_weaver>zRecursive was wanting the FreeBSD Guile-2 package also.
<zacts>mark_weaver: yep, I chatted with him a bit.
<mark_weaver>cool :)
<zacts>or her. don't know?
<zacts>but yeah..
<civodul>Hello Guilers!
<wingo>moin :)
<zacts>mark_weaver: sent an email to my ports mentor..
<zacts>with the patches for initial progress with guile. next we are going to clean up the patches, and then submit to the ports mailing list.
<mark_weaver>zacts: excellent! :)
<taylanub>zacts: FYI third-person pronouns are acceptable as gender-agnostic pronouns in English. (And then there's made-up ones but not many people recognize them so it can cause confusion.)
<zacts>taylanub: I'm a native speaker, but often type fast..
<zacts>taylanub: his/her when I don't know. ^_^
<zacts>but even that sucks..
<zacts>darn English!
<mark_weaver>taylanub: I'm a native speaker too, and I think your statement is not really true.
<mark_weaver>well, I'm sure that the average male finds it acceptable to use male pronouns by default, but that's not saying much.
<zacts>I usually say "him or her" or "they"/"them"
<taylanub>Oh uh, I didn't mean third-person .. what's the correct term .. they/them/their
<taylanub>Plural third-person
<zacts>my English teacher 'corrected' my use of they/them/their to 'his or her'
<mark_weaver>ah, well, that is indeed common.
<zacts>but I disagree with her
<mark_weaver>there are a lot of different opinions on this topic.
<taylanub>(Looks like I'm the only non-native speaker here ATM, after all. :P)
<zacts>yeah
<zacts>anyway, laters
<mark_weaver>civodul: is a non-native english speaker, but you wouldn't know it. his written english is better than most native speakers I know :)
<civodul>oh thank you :-)
<civodul>i guess you could tell it when you hear me though ;-)
<mark_weaver>well, yes, you have a noticeable accent, that's true :)
<mark_weaver>different skill set, I guess.
<mark_weaver>and actually, not worth the effort for you anyway. there are more important things to work on.
<taylanub>BTW a macro-wrapper for my bytestructures is difficult after all. :( On ref/set operations, I'll need either to expand to code that makes n record-field references for a compound descriptor of depth n (e.g. (1)vector of (2)struct of ... (n)uint32) because the bytevector-ref/set procedure to be called is found in the deepest descriptor (uint32 in our example), or find some alternative to injecting procedures into macro output (like
<taylanub>introducing top-level gensyms that get bound to the correct objects at program start).
<wingo>taylanub: make the macro define a macro
<wingo>see https://gitorious.org/guile-nagle/guile-nagle/source/0fcfe6dd6ac232785e06ec9a33608495c3d5e2f3:nagle/packed-struct.scm
<wingo>project name not really chosen yet
<taylanub>I'll take a look but, the goal in my case is to re-use the procedural implementation as much as possible. I'd like it to use the same "bytestructure descriptor" objects for both implementations.
<taylanub>Otherwise I think the problem would be mostly solved if I changed my descriptor objects to work on the syntax domain and save identifiers naming procedures, instead of procedures themselves.
<wingo>whatever dude :)
<wingo>you could define a syntactic implementation and use it to generate a procedural implementation.
<civodul>wingo: sounds fun!
<civodul>we need the packed struct thing in core Guile at some point
<wingo>indeed
*wingo going to try to compile figl's particle demo inner loops to assembly today :)
<civodul>woow!
<taylanub>I think bytestructures generalizes packed-struct quite a bit, just lacking the compile-time offset calculation as of now ..
<nalaginrut>wingo: compiling with master?
<wingo>nalaginrut: it will use master but it will be a special-purpose compiler
<wingo>not planned for merging
<nalaginrut>wingo: Is the bytecodes design confirmed now?
<wingo>nalaginrut: it's fairly stable, yes -- i'm not compiling from bytecode though
<wingo>going direct from cps
<nalaginrut>well, so it's OK to hack/learn rtl now, right?
<wingo>sure
<nalaginrut>nice~
<mark_weaver>nalaginrut: there might still be some small changes though, such as add1/sub1 --> add-immediate
<mark_weaver>and maybe some more instructions added.
<nalaginrut>mark_weaver: you always elaborate it precisely, but it's appreciated, thanks for explaining ;-P
<mark_weaver>heh :)
*wingo loves extending the compiler without restarting
<nalaginrut>extending compiler on the fly?
<taylanub>What would you recommend for protecting an object from the GC until a certain point in Scheme code ? (I'm using the FFI in funky ways.) Something that will be immune to even the most aggressive optimizer. I'm thinking (with-output-to-file *null-device* (display object)), maybe there's a better way. This is for a contrived piece of test-suite code by the way, no worries about how unusual it is.
<taylanub>I decided to go with (display (eq? #f obj)) to prevent a potentially costly `display'. (Really just bikeshedding here...)
<dje42>civodul: re: the libgc 7.4 issue you found: There's now a guile component in gdb's bugzilla if you want to file a bug report
<civodul>ahah, you got me :-)
<civodul>fortunately, there's jemarch's fancy bugz-mode
<TheBrayn>hi
<TheBrayn>I want to write a function that tries to match a regex which is passed to that funktion with a string, how can I validate this regex?
<civodul>TheBrayn: you can try to instantiate the regexp, with 'make-regexp'
<civodul>see the (ice-9 regex) module
<TheBrayn>and how can I catch an error if the regexp is invalid?
<civodul>'make-regexp' throws an exception if the regexp is invalid
<civodul>so you can catch it
<TheBrayn>yeah I don't get how catch works
<civodul> https://www.gnu.org/software/guile/manual/html_node/Catching-Exceptions.html
<TheBrayn>ok thanks
<TheBrayn>I was maybe looking in the wrong place
<saul>Good news: GNUcash 2.6.1 has been released; which is the first stable version with support for Guile 2.0 .
<taylanub>\\o/
<davexunit>yay!
<davexunit>great news.
<ArneBab>saul: nice!
<civodul>yay!
<cluck>:)
<wingo>man, i complain about tests, but i love our peval tests.
<wingo>we should figure out a way to test cps also, but it's so much more verbose that there's more churn
<wingo>maybe now that things have settled down...
<civodul>heh
<TheBrayn>has this implemented yet? https://github.com/NalaGinrut/guile-colorized/tree/upstream
<wingo>,optimize (let lp ((n 1)) (if (= n 1) (let inner () (inner)) (lp (1- n))))
<wingo>^ interesting case that doesn't peval
<wingo>it tries to do so, but the inner loop exhausts the effort counter and the whole "lp" unrolling attempt aborts
<civodul>interesting
<wingo>this prevents my "parallel-iota" thing from fully unrolling even when you specify that you only want to use one core
<stis>heya guilers!
<madsy>hey stis
<ArneBab>Is there already a version or preview-version of lilypond which supports guile 2.0?
<madsy>ArneBab: No idea. Ask the lilopond devs? :)
<madsy>lilipond*
<madsy>GAH.. lilypond*
<ArneBab>madsy: ok ☺
<ft>So, why would this work: (dynamic-link "libm"), while this doesn't: (dynamic-link "libc")? [yet, (dynamic-link "libc-2.13") does]
<wingo>ft: try an strace?
<civodul>ft: try (dynamic-link)
<saul>ArneBab, Lilypond released a stable version just before the end of the year that presumably supports Guile 2.0 (woot!).
<ft>wingo: that's an idea, I'll try that.
<ft>civodul: doesn't that return a handle that covers every symbol available at the time it is run?
<civodul>ft: yes it does, but that typically include libc symbols
<saul>ArneBab, version 2.18 . I say presumably because the previous 2.17.x dev branch supported Guile 2.0
<ft>wingo: It tries to "open("/usr/lib/x86_64-linux-gnu/libc.so", O_RDONLY) = 5" which apparently succeeds, but it still goes on to try "open("/usr/local/lib/libc.la", O_RDONLY) = -1 ENOENT" next.
<ft>wingo: With libm, it does "open("/usr/lib/x86_64-linux-gnu/libm.so", O_RDONLY) = 5" and that's seems to be it.
<ft>civodul: That's probably true, but I thought, it might make sense to limit scope... And now I'm mainly wondering why this doesn't work. :)
*ft installs ‘libtool-doc’
<ft>Ah, I think it bails out because /usr/lib/x86_64-linux-gnu/libc.so is a GNU ld script
<ft>Yes, and the libm.so in the same place is an actual ELF file.
<ft>well, it's a symlink to an actual ELF file.
<ft> http://lists.gnu.org/archive/html/bug-libtool/2008-04/msg00120.html and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477188 seem to be related.
<ft>Feels like a can of worms. So, I guess I'll go the (dynamic-link) route.
<dsmith-w`>Yeah, the C library often already loaded...
***dsmith-w` is now known as dsmith-work
<ft>Until guile compiles to machine code, there's no way around that, I guess. :)
<ft>heh, https://www.gnunet.org/bot/log/guile/2014-01-22
<ft>dje42 had exactly my problem not so long ago. Seems like I wasn't paying attention. :)
<ft>dje42: Did you get anywhere with (dynamic-link "libc")?
<dsmith-work>ft: Even direct to machine code, it will still probably use some C lib functions.
<ft>dsmith-work: Even if the program is trivial? Like, compute (* 2 3) and return that to the system?
<dsmith-work>Yeah, even then I would think. (But what do I know)
<stis>potluck sent
<davexunit>I don't have anything for the potluck again. :(
<ijp>I remembered the last two times, but I doubt I'll have anything this year
<stis>I hope that a prolog feature in a guile potluck is not like swearing the church ;-)
<taylanub>Wonder if I can fix a macro implementation of my bytestructures by then.
<davexunit>I wonder if I can make a guile-2d demo or something...
<madsy>hey davexunit :)
<davexunit>hey madsy
<madsy>Can I somehow list all the exported symbols in a package? :)
<madsy>I'm using geiser if that helps
<ijp>C-c C-d RET
<madsy>Nice, thanks
<ijp>,b / ,binding will tell you the ones bound in the current module
<madsy>I'm adding stuff to a module I defined in the C API, so I want to make sure that works like I intended
<madsy>That is, I created a module (guile-demo opengl) in the C API and added all my OpenGL entrypoints there. Now I want to add a couple of macros to the same module, but from scheme
<dsmith-work>madsy: Typically, there is also a .scm module that loads the C code from a .so and then exports things. You can add macros there.
<dsmith-work>Like examples/box-dynamic-module/box-module.scm
<madsy>dsmith-work: Yep, I will. Except the OpenGL bindings are added to the binary itself (i'm using libguile not guile), so I don't need to use load-extension
<didi>People, we need a better manual organization. The only way I can do it is by knowing the location of a specific section or by C-s inside the Info manual.
<mark_weaver>didi: do you ever use 'i' to search the index?
<ijp>didi: agreed, there are a bunch of issues with organisation, but it's an unsexy task to fix
<didi>mark_weaver: I don't. Useful feature, thank you.
<didi>ijp: I understand.
<didi>I feel things are all over the place.
<mark_weaver>didi: I agree with you. Are you volunteering to fix it?
<didi>mark_weaver: I am not.
<mark_weaver>okay
<didi>Also, it's not like the information is not there. It's just awkward to find.
<mark_weaver>*nod*
<didi>We could, for example, turn the manual inside-out a little. For me, "API Reference" feels like /the/ manual.
<didi>"Guile Modules" could be merged with "API Reference" (after changing its name) and the functionality, rather than the modules, be presented.
<mark_weaver>didi: I agree with all of that, but talking about it is easy. someone needs to actually do the work.
<didi>mark_weaver: Right right.
<didi>I don't know how the project feels about it, but the manual could turn down a little the guile capability of being a library extension while turning up the fact that it's a full fledged Scheme implementation.
<mark_weaver>agreed