IRC channel logs

2015-11-17.log

back to list of logs

<daviid>I've uploaded Grip's web-pages, 1st version! http://www.nongnu.org/grip/index.html
<daviid>I hope the examples page will invite guilers to use Guile-Clutter!
<koz_>daviid: Guile-Clutter is a thing? Neat!
<daviid>koz_: yes, I will release tonight or tomorow night
<daviid>rlb: time for multiple inheritance i would say
<koz_>daviid: That's pretty awesome. Congrats!
<daviid>koz_: thanks!
<daviid>the bouncer and the toolbar are pretty sophisticated examples actually
<daviid>but more to come in the future
***darthlukan_ is now known as darthlukan
<koz_>I really wish I had an ounce of game designer and an ounce of artist in my body.
<daviid>rlb: if you have a set of classes that alwys repond to a specific method [or methods] you define a class which these inherit from, then a single method def applies to all subclasses ...
<daviid>koz_: you do, this is a philosophical point that has been made... you just ignore it, maybe
<daviid>absolutely every single human beeing is an artist, that is the rule, not the exception, think about it!
<koz_>daviid: Yes, but what I mean is 'in terms of making stuff that I personally would want to see'.
<koz_>I'd love to make, for example, a free software MM6. However, I lack the time and talent (and honestly, *desire*) to learn all the stuff that this would involve.
<daviid>koz_: here https://www.gnu.org/software/guile-gnome/clutter/
***NeverDie_ is now known as NeverDie
<koz_>daviid: Thanks!
<nalaginrut>morning guilers~
<koz_>Afternoon nalaginrut.
<nalaginrut>heya
<davexunit>ACTION attempts to build Sly with guile master
<cmhobbs>gl;hf
<nalaginrut>ACTION is going to try sly game today
<cmhobbs>i should be learning me some more guile today but i just moved from jessie to trisquel and i'm moving all my stuff over
<cmhobbs>i am a digital hoarder, apparently
<davexunit>hmmm, trying to eval code with C-M-x in geiser gives this error with guile 2.1.1: ERROR: no such language objcode
<koz_>Would anyone here be OK with an extended PM discussion on how to optimize (and possibly refactor) Guile code? I have something I need to improve the performance of significantly.
<nalaginrut>koz_: could you post it?
<rlb>sneek: tell daviid Understood, but I one of the classes already exists, i.e. <null>, so I assume I can't (or shouldn't) change it's superclasses.
<sneek>daviid, rlb says: Understood, but I one of the classes already exists, i.e. <null>, so I assume I can't (or shouldn't) change it's superclasses.
<rlb>s/I one/one/
***ft_ is now known as ft
***siel_ is now known as siel
<koz_>If I want to use structures or define-inline in a module, do I have to put them before everything else?
<koz_>Also, in a define-module, is something like #:use-module (srfi srfi-1 srfi-43) gonna work as I expect?
<koz_>Also, I'm sadface that my distro haven't upgraded their Guile... :(
<nalaginrut>WoW! BOOTSTRAP GUILEC ice-9/eval.go in my i7 8 cores machine...
<koz_>nalaginrut: If I have record definitions in a module, must they be placed before any of their functions are called?
<koz_>Even when compiling?
<nalaginrut>koz_: I'm not sure about your question
<taylan>koz_: (srfi srfi-1 srfi-43) is one module name (and such a module doesn't exist of course)
<koz_>nalaginrut and taylan: Will this work - http://paste.rel4tion.org/106 ?
<taylan>there's (use-modules (foo bar) (baz bat) ...) but there's no #:use-modules equivalent, only #:use-module which needs to be repeated
<taylan>and I believe define-inline needs to appear before the use of the inlined procedure. define-inline mostly just expands to a macro.
<taylan>koz_: what exactly there do you expect to not work?
<koz_>I tried to load it into a simple script and it spewed a pile of warnings at me.
<nalaginrut>koz_: but you have to export records and its accessors too
<koz_>Script in question: http://paste.rel4tion.org/107
<taylan>koz_: maybe you should paste the warnings :)
<koz_>(file is in the same directory as the module I just c/p'd, hence the -L ..)
<koz_>taylan: http://paste.rel4tion.org/108
<koz_>As per request. :)
<taylan>koz_: does it work when you move the define-public below all the define-record-type?
<koz_>taylan: Yes.
<koz_>Hence my earlier question - I wasn't sure if this ordering was forced, or if I could do something to avoid it.
<taylan>hmm, I don't think there's much that can be done about it
<taylan>but I'm not sure
<taylan>ACTION wonders why record constructors become macros
<koz_>It creates some rather annoying ordering issues, especially when combined with define-inline.
<koz_>(also, there needs to be a define-public-inline)
<taylan>you can export things with #:exports in the define-module form
<taylan>I think things should work fine when the order in which you define things is roughly: 1. record types, 2. macros, 3. variables
<nalaginrut>koz_: the definition order matters in current Guile IMO
<koz_>nalaginrut: As I'm discovering.
<nalaginrut>say, (display a) (define a 123) will throw exception
<taylan>(I somehow never had ordering issues, following an order I find intuitive, but intuition is always personal)
<nalaginrut>Guile compiler doesn't support foward-reference, so the order matters
<koz_>Well, that's good to know. Thanks!
<lloda>are you sure you need define-inlinable? programs should first work without errors before introducing micro-optimizations of that kind
<taylan>koz_: you might want to open a bug report about the error you get when the order of the define-public and define-record-type is like in your example. IMO Guile could at the very least give a better error message...
<koz_>lloda: I might not need it, you're right, but it's nice to know about ordering. taylan: Sure, I can open a bug.
<koz_>Where would I do that?
<taylan>mailing to bug-guile@gnu.org
<koz_>taylan: Right on it.
<taylan>thanks :)
<koz_>OK, sent away.
<koz_>I gave as much detail as I could.
<koz_>Do I understand correctly that (reverse lst foo) is the same as (reverse (cons foo lst)) ?
<taylan>koz_: only 'reverse!' takes a new-tail argument
<taylan>(reverse! '(foo bar) '(baz)) => (bar foo baz)
<taylan>(reverse (cons 'baz '(foo bar))) => (bar foo baz) also
<koz_>Oh, the new-tail needs to be a list.
<taylan>well it doesn't need to be
<taylan>(reverse! '(foo bar) 'baz) => (bar foo . baz)
<taylan>it simply becomes the new tail :) you might want to look into how lists are built up of cons cells aka pairs
<koz_>Makes sense.
<taylan>(if you haven't already)
<koz_>I have - but thanks for clearing up the action of reverse and reverse! for me.
<civodul>Hello Guilers!
<koz_>Hi civodul!
<koz_>If I wanna call statprof from a script, do I need to use-modules anything?
<civodul>yes: (use-modules (statprof)) and then 'with-statprof'
<koz_>civodul: Thanks!
<koz_>Wtf does it mean if statprof chucks this at my face? statprof.scm:459:21: In procedure statprof-call-data->stats:
<koz_>statprof.scm:459:21: Throw to key `numerical-overflow' with args `("/" "Numerical overflow" #f #f)'.
<lloda>your program may not last enough for statprof to collect samples (just a guess)
<koz_>lloda: OK. I guess I need to give it harder work to do.
<koz_>Although I've got this for what I'm doing: (display (with-statprof (run-on-data data) #:loop (* billion billion) #:hz (* billion billion) #:count-calls? #t))
<koz_>With an appropriate definition of billion, of course.
<koz_>When I call procedures with keyword arguments, can the keyword-argument pair go anywhere, including before non-keyword arguments, in the call?
<lloda>keyword arguments need to go after non-keyword arguments. If you pass them before, then the keyword itself will get passed as a non-keyword argument
<lloda>trivially (list #:hello 'world)
<lloda>$1 = (#:hello world)
<lloda>
***mario-go` is now known as mario-goulart
<wingo>i think with-statprof is a hacky macro that expects keyword arguments first
<wingo>koz_: ^
<ane>ACTION is writing an IRC bot in Guile, because why not
<davexunit>yay!
<ane>and the idea is a bit zany
<ane>i'm writing the base network i/o etc. in Rust and then linking with libguile that loads the stuff itself
<ane>part of this is just for fun: Rust FFI + Guile, why not?
<ane>and i'm sure every problem is completely ungoogleable
<davexunit>pure guile is the way to go
<ane>yeah, that's the plan eventually
<davexunit>but you're free to have your fun :)
<mark_weaver>I agree with davexunit that pure guile is the way to go. you're likely to run into a lot of complications from the impedance mismatch between guile and its garbage collector and Rust which doesn't use one.
<mark_weaver>of course, projects have successfully made the two work together, but it's best avoided if you can do so reasonably, and this seems like a case where it doesn't buy you much
<mark_weaver>ane: ^^
<mark_weaver>IMO anyway
<wingo>ACTION agrees
<dsmith-work>Tuesday Greetings, Guilers
<unknown_lamer>I'll rewrite bobot++ in guile one of these days (read: never)
<unknown_lamer>sneek: botsnack
<sneek>:)
<ane>mark_weaver: oh yeah, i want to see what happens anyway
<paroneayea>hello!
<davexunit>hey paroneayea
<paroneayea>hi davexunit
<paroneayea>davexunit: remember this conversation with mark_weaver? https://lists.gnu.org/archive/html/guile-devel/2015-10/msg00015.html
<paroneayea>davexunit: I'd like to clarify that thread with what the binary port stuff was, because I can't remember
<paroneayea>and it would be useful to have documented
<paroneayea>I thought it was something like: the way that you'd do IO involves binary ports, and those would themselves have access to the prompt to the current agenda through a fluid or something?
<paroneayea>was that it?
<ane>ACTION got the REPL working, then decided it was a stupid idea
<ane>100% guile it is
<davexunit>paroneayea: I think the idea is that we'd use Guile's custom port interface to do the necessary abstraction for this async stuff
<paroneayea>davexunit: that sounds right, though I'm not sure what that part would look like... I know what most of the rest of the event loop would look like
<davexunit>I don't know exactly what it would look like because I've never used custom ports, but here's an initial guess with some pieces missing:
<ane>fwiw https://gist.github.com/ane/fef5b05882ad90511482 here's how to start the REPL in Rust!
<davexunit>paroneayea: the 'read' operation of this port type would yield to the scheduler and schedule the file descriptor to be polled for input
<davexunit>when the file descriptor can be read from, the read operation continues and the continuation is applied
<davexunit>ane: neat!
<davexunit>I've never really seen rust code before
<davexunit>looks like C++ basically
<davexunit>:/
<paroneayea>davexunit: interesting, ok
<davexunit>you can use Guile's built-in 'select' to poll file descriptors for this purpose
<paroneayea>davexunit: great, thanks :)
<davexunit>I think a proof-of-concept implementation wouldn't be too hard to write
<davexunit>if guile provides a way to do non-blocking reads already
<davexunit>paroneayea: it looks like Chris Vine already has something like this
<davexunit>maybe you should ask him for the source?
<paroneayea>davexunit: oh, where'd you see that?
<paroneayea>(I don't know who Chris Vine is)
<paroneayea>davexunit: if you can point me to where you saw that, I can contact him.
<davexunit>paroneayea: in the thread
<paroneayea>oh
<paroneayea>!
<paroneayea>davexunit: wow, was that only a month and a half ago?
<paroneayea>so much has happened lately
<davexunit>haha yeah
<n8willis>Hi.
<n8willis>I'm pouring over the 2.1.1 release notes, and in the thread-safe API section, I'm seeing a lot of "for more info, see XXX"
<n8willis>(literally; that's not xxx as my placeholder)
<davexunit>placeholders for 2.2 release notes I think
<n8willis>I don't suppose anyone could steer me toward more info on the APIs could they?
<davexunit>the thread-safe port stuff is still up in the air, actually.
<n8willis>davexunit, it's in the release announcement sent to guile-devel -- I'm not tryign to read an unreleased doc or anything
<mark_weaver>I should also point out that some of the changes listed there are still under contention.
<mark_weaver>by our versioning scheme, this is a pre-release.
<n8willis>mark_weaver, some of the changes in the API section, or other stuff cited elsewhere in the announcement
<n8willis>?
<mark_weaver>not a real release.
<davexunit>n8willis: I think they may have been left in by mistake or just left in because it's pre-release
<mark_weaver>some of the changes in the API section
<n8willis>davexunit, sure; I'm still keen on reading more about it, though.
<mark_weaver>e.g. the question of whether to have built-in thread synchronization for standard I/O procedures is still not settled.
<n8willis>ok
<mark_weaver>our version scheme is that the second number is even for production releases (e.g. 1.8.x, 2.0.x, 2.2.x), and odd for pre-releases.
<n8willis>mark_weaver, I get that; I'm sufficiently oldschool to recall the even/odd schemes of yore....
<mark_weaver>*nod*
<mark_weaver>so, for now, I would suggest searching the manual for keywords associated with the sections that say "see XXX", or you can ask here and I may be able to point you to more information.
<n8willis>willdo
<paroneayea>hi n8willis !
<paroneayea>(this is Chris Webber)
<n8willis>zup!
<paroneayea>nice to se you in #guile :)
<paroneayea>*see
<n8willis>aww shucks
<n8willis>yeah; just reading up on finalizers and whatnot
<ArneBab>ane: happy hacking!
<ArneBab>ane: could you write a short text about why you decided to go pure guile?
<ane>as mark_weaver said, memory reasons
<ArneBab>ane: or — if that’s easier — give a short quote?
<ArneBab>ane: interference between the two philosophies?
<ArneBab>ACTION looks at it from the PR angle: http://draketo.de/light/english/communicate-your-project
<ane>yes, plus, it doesn't really... help. i mean, if i'm starting from scratch anyway? it would be different if i had an IRC bot in language XYZ and wanted to extend it, but not rewrite it completely
<ArneBab>yepp :)
<ane>and if XYZ has good C FFI, it would make sense then, and only then
<ArneBab>the only advantage I could see would be if you wanted to use Rust for some high-performance datastructure.
<ane>that's true, but wouldn't I be able to go via Rust->C->Guile (as in, the Rust code is called from C, which is called from Guile)
<ArneBab>ah, yes…
<ane>instead of building everything on top of it
<ArneBab>I’ll be back later… cu
<ArneBab>(got to get the bicycle)
<amz3>héllo guilers
<amz3>what's going on?
<cmhobbs>work work, zug zug
<cmhobbs>:D
<amz3>:)
<cmhobbs>weird day at work, too
<cmhobbs>day before the end of the sprint is always both frantic and dull
<cmhobbs>rush around, finish stuff, then wait
<cmhobbs>i got some guile into the sprint though, so that's good
<amz3>usually I know a few days before the dead line whether it will be done or not for the deadline
<amz3>it's critical to keep the schedule up-to-date as it requires a lot organisation downstream
<amz3>but I know the "waiting" it's painful
<amz3>I used to hate this moments, a few months when I started, they I learned to take advantage of it
<amz3>I mean, a few months and I always had some thing to do during the "wait! The new sprint is not ready!"
<cmhobbs>ha
<amz3>cmhobbs: so you did guile, incredible story :)
<cmhobbs>i try to keep myself busy by tidying up some code
<cmhobbs>yeah, first production guile project
<cmhobbs>it just automates some system things
<cmhobbs>pushing to get them to release it under the gpl
<cmhobbs>this is the best job i've ever had. so far the only problem is that i build proprietary software... :
<cmhobbs>:/
<amz3>it's a build bot?
<cmhobbs>nah, just a script
<cmhobbs>essentially we provision these machines that need to install custom software that we've also built
<cmhobbs>and the machine can hit an api to figure out what information it needs to build our software
<cmhobbs>so i wrote a small guile utility that hoovers up that data
<cmhobbs>and then manages the build process
<cmhobbs>probably not the best use for guile but they said i could use whatever i wanted
<cmhobbs>it's readable and concise
<amz3>nice
<cmhobbs>and moves relatively quickly
<cmhobbs>i wish i could write some tests around it but i'm not sure how to do unit testing in guile
<cmhobbs>i have a lot to learn
<amz3>cmhobbs i have a small snippet for a unit test
<davexunit>cmhobbs: srfi-64 provides a unit testing interface
<amz3>go to http://hypermove.net/do-it-yourself-a-search-engine-in-scheme-guile.html
<amz3>a search for srfi-64
<cmhobbs>thanks!
<amz3>(string-tokens "...") is the procedure that is tested, it's 10 LOC
<amz3>string->tokens
<amz3>"tidying up some code" -> that's what I was doing until it wasn't possible anymore without a lot of organisation so I started writing documentation
<amz3>I think the best thing would be to improve the framework we use, and port the soft to this new version but that's a lot of work
<amz3>I will give guile-javascript another
<amz3>try
<cmhobbs>wait, does guile compile down to javascript or is it javascript compiling down to guile bytecode?
<cmhobbs>i hate javascript so i've stayed away from the guile related js things
<paroneayea>cmhobbs: there are two projects, both not totally usable
<paroneayea>cmhobbs: one is guile->js, there was a gsoc projedct that did some nice proof, but I don't think it's usable yet
<paroneayea>cmhobbs: the other one
<paroneayea>try
<paroneayea>,L ecmascript
<paroneayea>at a guile prompt
<paroneayea>and you can type some javascript things, and a certain amount of it works
<ane>also ,L elisp!
<cmhobbs>kk
<cmhobbs>thanks!
<koz_>OK, statprof is really annoying me with this error all the time: statprof.scm:459:21: Throw to key `numerical-overflow' with args `("/" "Numerical overflow" #f #f)'.
<koz_>What does this even mean anyhow?
<ArneBab>koz_: are you dividing something by zero?
<ArneBab>or testing a function which is so fast that the time is effectively zero?
<koz_>ArneBab: The latter, I guess? This only happens if I give it a #:count-calls? #t .
<mark_weaver>koz_: looking at the code, that indicates that 'num-calls' was 0.
<mark_weaver>about how long did the code run for?
<koz_>11-12 seconds.
<mark_weaver>I didn't write this code and I don't have time to investigate right now.
<mark_weaver>but it sounds like somehow no data was collected at all
<mark_weaver>actually, a few lines below that, (max num-calls 1) is used to handle the case where num-calls is zero.
<mark_weaver>along with a comment that num-calls might be zero in a specific case.
<mark_weaver>I believe wingo wrote this code
<koz_>mark_weaver: I decided to pass #:loop 1000 as well.
<koz_>And yeah, it seems like with-statprof *does* expect keyword args before the forms it profiles...
<koz_>(no wonder I was confused as hell)
<ArneBab>koz_: does it work now?
<koz_>ArneBab: Still waiting for it to finish. 11-12 seconds times 1000 is a while. :P
<ArneBab>ouch, yes…
<mark_weaver>12000 seconds = 3.33 hours
<ArneBab>I’d think that 4 or 5 should be enough for such a long-running function…
<ArneBab>(loop)
<ArneBab>maybe try #:loop 10
<mark_weaver>there might be some other problem, like maybe the timer interrupts aren't working for some reason.
<mark_weaver>or, if you're doing this on the 'master' branch of git, maybe it's just broken.
<koz_>ArneBab: Well, it gives me a chance to read some stuff. mark_weaver: Not on any master branches.
<mark_weaver>koz_: okay, but if the problem is elsewhere, that's a long time to wait to find out.
<mark_weaver>30 seconds should be plenty of time to run statprof
<koz_>mark_weaver: Yeah, fair enough.
<mark_weaver>koz_: are you using the ,profile REPL command, or what?
<koz_>mark_weaver: Calling it from inside the code with the with-statprof macro.
<koz_>OK, after doing #:loop 10, I still get that error...
<mark_weaver>well, maybe wingo can help, or else maybe you should email bug-guile@gnu.org about it
<mark_weaver>I don't have time to investigate right now.
<koz_>mark_weaver: OK, thanks anyway.
<koz_>wingo: Ping?
<paroneayea>ACTION lazily hacks on a generic scheduler/agenda/async event loop based on the fsf 30 discussions
<paroneayea>I could make this thing purely functional if I make use of ijp's pfds repo
<paroneayea>noticably, the immutable queues/deques paper referenced on there also references the name of what I think was one of my old colleagues at CC... I wonder if it's the same person?
<paroneayea>(maybe I should package pfds for guix?)
<civodul>+1!
<paroneayea>civodul: well a +1 from you is motivation enough! :) I'll get on packaging it! :)
<civodul>heh :-)
<civodul>we miss ijp
<paroneayea>yeah
<mark_weaver>+1
<paroneayea>cool, it *is* the Tyng-Ruey Chuang I knew from CC Taiwan!