***catonano_ is now known as catonano
<catonano>sneek later tell andswitch you're right, I missed the bit about the single page you wanted. Sorry ***rekado_ is now known as rekado
<rekado>tohoyn: thanks for the notice. It got stuck somehow. <wingo>sneek: later tell dsmith turns on i made a mistake that resulted in all optimizations being on, also for bootstrap :P things a little better now. *janneke hopes for a slight understatement there <wingo>depends on the file in question <wingo>is quite significant for bootstrap tho <janneke>that is great; i'm bootstrapping more than i would sometimes like, these days :) <wingo>janneke: you might like the bootstrap compiler, just for reading; it is 1400 lines and relatively straightforward <wingo>maybe mes has some tricks it could use or vice versa <janneke>wingo: yes, that's a nice idea! what's the entry point? <wingo>so the entry point is at the bottom <wingo>manumanumanu: o/~ caught in a landslide, no escape from reality o/~ <manumanumanu>I am going to have a go at the equal?/eqv? optimization today. We got some arctic cold these days, so all my fruit blossoms froze. No cherries. No apples. I am rage-quitting gardening for a while <wingo>will it help to say i see my neighbor's tree laden with reddening cherries from my window? i guess not ;) <manumanumanu>gardening in sweden is a lost cause. All I get is cabbage and carrots <manumanumanu>on the other hand, we got about 100kg carrots last year, and had kale through the winter <wingo>i moved 18 months ago and haven't set up a proper veg bed yet <manumanumanu>i'd suggest building your own raised ones instead of buying those flimsy ones <manumanumanu>the ones we bought when we moved in 3 years ago are all rotten by now, but the ones I built look like new ***madsy is now known as Guest47091
<rekado>manumanumanu: we barely scraped by freezing; my trees don’t look happy at all. And my watermelons died. <manumanumanu>To make the gardening a bit more on-topic: guile is powering my self-watering flower pot :D <wingo>at one point a few years ago i wanted to compile part of guile to a microcontroller to open and close the door of my chicken coop <wingo>of course i never got around to doing it ;) <wingo>janneke: a -j1 make in bootstrap/ now takes 11 minutes for me <manumanumanu>so about 80% guile 20% python to measure impedance between two nails and start a pump if the it is too high (dry soil) <wingo>i suspect the best you could do with -j40 would be 5 or 6 minutes, because of having to build eval.go and psyntax-pp.go first <manumanumanu>I only managed to empty the water onto the floor once or twice :D <janneke>wingo: eh, is that a full bootstrap; that used to take 2.5h? <wingo>you have built libguile/. you have no .go files, no prebuilt/ <wingo>that was "time make -C bootstrap/ -j1" <janneke>(not to bring back the dead, but...) <wingo>not sure. it would need VM work as well as compiler work <wingo>i.e. possibly-missing instructions <wingo>best to let 2.2 lie sleeping IMO :) <janneke>wingo: ah, i only really meant "...a mistake that resulted in all optimizations being on," <wingo>ah that. no that was a recent mistake introduced when shoehorning the baseline compiler into the <language> graph <janneke>i'm not advocating any significant work <wingo>the speed improvement is because of the baseline compiler + trimming the bootstrap module graph <janneke>bootstrap dependency reduction; *love it* <wingo>make -j4 just got me down to 9m42s in bootstrap/; there are some "long poles" that won't fold up into the bag, it seems <manumanumanu>wingo: when I'm at it looking at some primitiv expanders, are there any others you have thought about but not really bothered about? <wingo>manumanumanu: which primitive expanders are you looking at? i am pretty good at forgetting about things i decided to not bother about so i can't answer the question :) *wingo casts short memory into a virtue :P <manumanumanu>now I am looking at turning equal? into more efficient forms for (const ...)s where it makes sense <wingo>incidentally peval can be a really good place to do that sort of thing <manumanumanu>I just thought language/tree-il/primitives.scm is the place to do it since that is where equal/eqv -> eq? is doen <wingo>make -j4 -C module/ after a bootstrap runs in 3m36s on this now-aging laptop <wingo>finally, a make -C bootstrap/ -j4, with prebuilt/ built, runs in 12s. <manumanumanu>If I understand correctly, all numbers are eqv? all other numbers in guile, even complex and inexact numbers. <wingo>i mean of course (eqv? 1 2) is false <wingo>but you mean that (eqv? N M) == (equal? N M) <RhodiumToad>two numbers can be = but not eqv?, though, if one is exact and the other not <manumanumanu>oh yes, but now I am turning equal? -> eqv? which has a similar number comparison semantics iirc <manumanumanu>(equal? 0.1 1/10) = #f which is true for eqv. (equal? 0 0/10) -> #t which is also true for eqv? <RhodiumToad>if at least one of the operands of equal? is a number, then the result is equivalent to the result of eqv? on those same operands <RhodiumToad>the edge case I found is that an exact complex number whose imaginary part is exactly 0 is actually an exact real number <RhodiumToad>as I said, if at least one operand of equal? is any kind of number, then the result is the same as using eqv? <wingo>1+0i is not the same as 1+0.1i <wingo>1+0i is not the same as 1+0.0i <manumanumanu>now, is there a way to run guile from the source folder where i just completed a 'make'? <wingo>incidentally if you just finished a make, i suggest git pull and make again <wingo>that way you will have the new baseline compiler <RhodiumToad>looking at r5rs, it says that eqv? is true if the operands are both numbers, have matching exactness, and are = <manumanumanu>it turns into very fast code though! (equal? #\a #\a) -> (#f) <manumanumanu>the reason seems to be that I don't know scheme. I literally forgot a (cond ...) <manumanumanu>no, somewhere in the compile I ended up with ((and blah blah blah)) which tried to apply (#f) <RhodiumToad>r7rs says that two inexact numbers are eqv? if and only if scheme's standard arithmetic procedures can't tell them apart. <RhodiumToad>perhaps 1.0 is treated as 1.0+0i such that the imaginary part is exactly 0? <efraim>perhaps this is more of a Guix question, but if I've created a gexp how do I invoke it from a guile REPL? <wingo>efraim: i think there is some kind of guix repl extension <wingo>perhaps a guix person knows more <wingo>but you have to evaluate it within a store monad i think <wingo>so thee repl extension lets you enter the monad <efraim>thanks. I guess it's not a problem when it's already inside a script to do the store monad dance <manumanumanu>wingo: you weren't kidding when you said it is easy to get wrong. I managed to actually get it wrong again and always simplifying equal? to eqv?. I forgot that primitive-expanders should return #f iif no expansion should be done. <wingo>we could ask for a new debbugs component or so; i think civodul knows more about that <manumanumanu>so, wingo: tests are changed, no fails. tests are added, all pass. However: I just extended the already existing procedure. That means we are only optimizing the less-than-three-arguments form. (equal? toplevel-x #\a) -> (eqv? #\a toplevel-x), but (equal toplevel-x toplevel-y #\a) -> (and (equal? toplevel-x toplevel-y) (eqv? #\a toplevel y)) <wingo>yeah that can usually be a straightforward recursive change <manumanumanu>due to how the code was written, it ended up being a little bit more than that. I restructured it so that call to eqv? or equal? has it's arguments checked in order. If there are any eq-able or eqv-able literals that is the primitive used, otherwise don't do anything <manumanumanu>The problem is I suspect the output from (make-conditional ...) is run through the primitive-expander once again, meaning we don't get o(n) <manumanumanu>no... for both eqv? and equal?. (equal? a b c d e) checks all args for simplifiable literals and turns it into (and (equal? a b) (equal? b c d e)) which in turn checks (b c d e) for simpflifiable literals, which in turn would be an eternal shame to submit as a patch <RhodiumToad>hm, really you want to know what is the most simplifiable literal in the list before generating any clause <RhodiumToad>so if any arg is a symbol or keyword, you can reduce all the tests to eq?. otherwise, if any arg is a number or character, then they all reduce to eqv? <weinholt>manumanumanu, weird that equal? works with any number of arguments, the manual says it takes exactly two arguments ***dddddd__ is now known as dddddd
<guix-vits>weinholt: (help equal?) -> "- Scheme Procedure: equal? [x [y . rest]]" <manumanumanu>wingo: there is a patch on the mailing list. It isn't pretty and needs a little discussion. Anyway, thanks for the help! *guix-vits "same for eqv?: manual says x y, not [y . rest]. Confusing." <wingo>i fixed the speed thing i think <wingo>want to give a try to a fresh build? <wingo>a -j4 build from nothing should complete in around 20 minutes for the whole thing <wingo>civodul: if you are able, give current guile another go on python-xyz.scm <wingo>there was a bug that accidentally turned on all tree-il optimizations :P ***Guest53758 is now known as jao
<civodul>random thought of the day: what if we put Guile as the PT_INTERP of a .go file? <wingo>civodul: would be interesting! lots of paths to get right tho <wingo>in guix context you can do it, obvs <wingo>dsmith-work: great! so around 2x as fast as 3.0.2 bootstrap without prebuilt files. <wingo>iirc your number yesterday was 77m for 3.0.2 <wingo>thanks for testing, i might have missed this bug if you hadn't tested <wingo>dsmith-work: similar but a sequential build will usually have less user time than a parallel build, because later steps can take advantage of previous steps <wingo>manumanumanu: you nerd-sniped me ;) see the list <wingo>with regards to "match", and "case" for that matter, we really need to compile chained conditionals better :P <mwette>Does that mean something like this? (('a 'b) ...) (('a 'c) ...) => (('a . ,rest) (match rest (('b) ...) (('c) ...) <wingo>needs to be done at the CPS level though, so that the component parts of e.g. (match exp (($ <a>) ..) ($ <b>) ..) ...) can work <mwette>On occasion I'm guilty of hackage to avoid case forms. <alextee[m]>i want to load a file and do some regex on every line and combine the results in a new string. i guess i'd do (with-input-from-file) and (fold), but is there a way to convert the file contents to a list of strings (one for each line)? <RhodiumToad>read-line will read one line, why would you want to make a list? <RhodiumToad>what I'd do is probably with-input-from-file and with-output-to-string <alextee[m]>actually i think i dont.. i just want to do some regex and just (display) the result for each line, so read-line will work, thanks! <alextee[m]>i'm doing with-output-to-file, and then inside that with-input-from-file <alextee[m]>(reading a list of translators from a file and generating a C string to dump in a C header file) <civodul>wingo: python-xyz master -O0: 2m10s wall-clock <civodul>python-xyz 3.0.2 -O0: 2m40s wall-clock <civodul>time(1) says 693M (master) vs. 746M maxresident, FWIW <civodul>wait a minute, i was doing it wrong, not sure why <civodul>it's down to 3.8s and 287272maxresident, much nicer :-) <civodul>was i using the wrong optimizations-for-level before, go figure ***dongcarl7 is now known as dongcarl
<alextee[m]>is my use of (read-line) wrong? it seems to stay on the first line and that loop keeps displaying the first line forever. isn't it supposed to move the iterator on the current input port by default? *alextee[m] reads the docs again <alextee[m]>yeah i missed the [step] part, sorry for the noise :-) <RhodiumToad>(do ((line (read-line) (read-line))) ... or something like that <manumanumanu>wingo: regarding case, I have a case macro that does a binary search for more-than-n elements <manumanumanu>btw, I'll read the patch and try to understand what it does. <manumanumanu>I had a macro that resulted in huge case macros, and shaved a lot of time from it by doing a binary search. I thought about doing it with a hash table, but I never got to that <manumanumanu>Racket does o(logN) case dispatch, so I suspect they do a binary search as well <alextee[m]>is it possible to remove characters from an output port? <justin_smith>I'd suspect that for an arbitrary port this is impossible, but if it were possible to wrap a port in a buffer, you could do so before the buffer flush <justin_smith>I suspect in guile your wrapper couldn't directly be a port <manumanumanu>RhodiumToad: andy's last patch seems to indicate all, but I am not sure I understand it <alextee[m]>i see, thanks. i'll handle my problem in a different way then (make a list so i can tell if it's the last element or not and not print the extra chars) <RhodiumToad>alextee[m]: if it's a random access port, such as a file port, you can seek backwards <RhodiumToad>however, that would seek in bytes, not in characters <alextee[m]>i think using a list in what im doing will be more elegant. i'll try and report back :-) <RhodiumToad>manumanumanu: I'm guessing that characters are always immediate values, since all unicode codepoints easily fit in even a 32-bit word with enough space for type tags <RhodiumToad>yup, reading the C code that does appear to be the case <RhodiumToad>numbers small enough to fit in a word with 2 spare bits for tag are immediate values, and will compare as eq <RhodiumToad>hm, that said, it's somehow still managing to compare them as equal <RhodiumToad>(define a 2000000001) (define b (1+ 2000000000)) (eq? a b) => #f <alextee[m]>now i dont have to copy the translators from the TRANSLATORS file in the about dialog manually anymore : P <alextee[m]>i'll do this for the credits section in the manual too <wingo>civodul: from 220s to 4s ??? <wingo>civodul: would be interesting to compare -O2 with -O2 -Ono-letrectify <civodul>wingo: so i'm doing a full build of the 'guix' package <civodul>its peaks at "only" 780M resident towards the end <andswitch>Does a nested define create a closure like a lambda does? <sneek>andswitch, you have 1 message! <sneek>andswitch, catonano says: you're right, I missed the bit about the single page you wanted. Sorry <civodul>andswitch: the compiler inlines it when appropriate <justin_smith>I'd expect it to turn into the same thing a let* binding would