<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>the bouncer and the toolbar are pretty sophisticated examples actually ***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. ***NeverDie_ is now known as NeverDie
<davexunit>ACTION attempts to build Sly with guile master <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 <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. <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. ***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? <taylan>koz_: (srfi srfi-1 srfi-43) is one module name (and such a module doesn't exist of course) <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 <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 ..) <taylan>koz_: does it work when you move the define-public below all the define-record-type? <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>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_>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>(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_>I have - but thanks for clearing up the action of reverse and reverse! for me. <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_>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) ***mario-go` is now known as mario-goulart
<wingo>i think with-statprof is a hacky macro that expects keyword arguments first <ane>ACTION is writing an IRC bot in Guile, because why not <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 <ane>yeah, that's the plan eventually <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 <unknown_lamer>I'll rewrite bobot++ in guile one of these days (read: never) <ane>mark_weaver: oh yeah, i want to see what happens anyway <paroneayea>davexunit: I'd like to clarify that thread with what the binary port stuff was, because I can't remember <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? <ane>ACTION got the REPL working, then decided it was a stupid idea <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: <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>you can use Guile's built-in 'select' to poll file descriptors for this purpose <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 <paroneayea>davexunit: if you can point me to where you saw that, I can contact him. <paroneayea>davexunit: wow, was that only a month and a half ago? <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) <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. <n8willis>mark_weaver, some of the changes in the API section, or other stuff cited elsewhere in the announcement <davexunit>n8willis: I think they may have been left in by mistake or just left in because it's pre-release <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. <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>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>yeah; just reading up on finalizers and whatnot <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? <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 <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) <ane>instead of building everything on top of it <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!" <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>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>probably not the best use for guile but they said i could use whatever i wanted <cmhobbs>i wish i could write some tests around it but i'm not sure how to do unit testing in guile <amz3>cmhobbs i have a small snippet for a unit test <davexunit>cmhobbs: srfi-64 provides a unit testing interface <amz3>(string-tokens "...") is the procedure that is tested, it's 10 LOC <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 <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>and you can type some javascript things, and a certain amount of it works <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>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. <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) <koz_>ArneBab: Still waiting for it to finish. 11-12 seconds times 1000 is a while. :P <ArneBab>I’d think that 4 or 5 should be enough for such a long-running function… <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. <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 <koz_>mark_weaver: OK, thanks anyway. <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>civodul: well a +1 from you is motivation enough! :) I'll get on packaging it! :) <paroneayea>cool, it *is* the Tyng-Ruey Chuang I knew from CC Taiwan!