IRC channel logs

2020-06-04.log

back to list of logs

<ArneBab>wingo: wow — cool! (more meaningful comments when I’m through :-) )
***apteryx_ is now known as apteryx
<lloda>how to set the compilation flags for autocompilation?
<lloda> ah %auto-compilation-options
<lloda>can this be set per module?
<civodul>hey!
<civodul>lloda: it's a global variable
<lloda>right
<lloda>do people actually precompile their Scheme? i rely entirely on autocomp
<lloda>actually it isn't clear to me how one would set -o2 or w/e in %auto-compilation-options
<lloda>I cannot find the format in the manual
<lloda>the default is just a list of warning symbols
<lloda>guild compile -Ohelp lists the flags but the summary options -O0 etc aren't available to %auto-compilation-options, or are they
<lloda>I think I might have asked this before sry
<lloda>oh (@ (system base optimize) optimizations-for-level)
<wingo>lloda: hey this changed recently!
<wingo>lloda: (use-modules ((system base compile) #:select (default-optimization-level)))
<wingo>(default-optimization-level 2)
<wingo>or use parameterize, etc
<wingo>same for default-warning-level
<chrislck>some error after converting all _ to gettext for guile-3.0: "WARNING: loading compiled file (...) load-thunk-from-memory: incompatible bytecode kind" using guile-3.0.1
<chrislck>oh guile-3.0 was looking into guile-2.2 cache
<wingo>maybe you had some precompiled .go files in your GUILE_LOAD_COMPILED_PATH that were compiled with an older guile
<chrislck>right.
<civodul>wingo: optimizations-for-level is still there though, right?
<wingo>civodul: yes :)
<wingo>though it isn't used in guile any more
<civodul>phew :-)
<civodul>ah ok
<wingo>whenever you can migrate to passing #:optimization-level as a param to compile-file, you should do so
<wingo>no urgency tho
<civodul>ok
<lloda>neat thx wingo
<wingo>civodul: incidentally one place to look for improving compile speed at -O0 / -O1 would be making fix-letrec do something simpler instead of computing SCCs
<wingo>like just do the standard letrec conversion instead or something, dunno
<wingo>or maybe it can be optimized in some better way
<wingo>b/c letrectification can produce big graphs to be teased apart into scc's
<wingo>(at higher levels)
<civodul>wingo: ok
<civodul>i haven't put any thought into all this!
<manumanumanu>wingo: fyi, your blog posts have been instrumental in getting me to understand what guile is doing behind the scenes. Not that I understand much, but reading through the guile posts over the last 10 years has made me write better code :D
<wingo>tx :)
<wingo>civodul: just responded to your mail. i think you will enjoy the statprof fix :)
***ecraven- is now known as ecraven
<manumanumanu>funny to see that the -O2 produces almost the same quality code as O1, except for some select benchmarks, where the gains are substantial. That is pretty cmuch in line with my own non-structured benchmarking of code.
<wingo>you mean -O3 vs -O2 perhaps?
<wingo>-O2 is significantly better than -O1
<wingo>also note that the meaning of -O1 changed in master to also include -Oresolve-primitives
<wingo>which it had excluded previously for $reasons
<manumanumanu>yes
<dsmith-work>Heigh Ho, Guileers
<lloda>is it fair to see that @@ shouldn't be used inside Guile?
<lloda>s/see/say
<wingo>lloda: inside guile it's fair game
<wingo>but better to export interfaces that are important
<wingo>i mean to say it's totally possible but best to design something we aren't ashamed of :)
<lloda>I used (@@ (ice-9 arrays) array-print-prefix) in pretty-print b/c I didn't want to export it
<lloda>but then I used it outside Guile
<lloda>but again I don't want to export it if I'm the only user :-|
<wingo>lloda: in this case i think it's fine :)
<wingo>like if it breaks you are holding both pieces and it's your fault ;)
<wingo>but probably since you are holding both pieces it won't break!
<lloda>ok :) i'll let it be
***jr0_ is now known as jr0
***deesix_ is now known as deesix
***sneek_ is now known as sneek
<bjoli>Did you ever feel that you couldn't fizzbuzz fast enough? Look no further, I have made a (really just one procedure) module to generate wheels: https://git.sr.ht/~bjoli/wheel-utils. Now you can fizz and buzz at twice the speed, generating gigabytes of fizzing and buzzing data!
<bjoli>i had it lying around. Some old code from 15 years ago when I did programming in HS. My teacher did not like that solution, even though it was by far the fastest and simplest to extend. Bless his poor soul.
<chrislck>they taught lisp in HS?/??
<bjoli>nah, I just implemented everything in scheme and ported it to whatever programming language we had to use.
<chrislck>very interesting that every lisp hacker has their own style :)
<dsmith-work>I guess Scheme is malleable enough that it can encode your ideas directly
*chrislck made it a personal mission to eradicate most unreasonable set! from gnucash, and this is now nearly complete
<dsmith-work>A worthy endeavor
<dsmith-work>A long time ago, you could make guile code faster by using set! everywhere (less garbage to collect)
<dsmith-work>Now it's the opposte. It constrains the compiler.
<civodul>yup :-)
<chrislck>🕺
<chrislck>also many, many loops reduced to 1 to minimise nested loops 🕺
<chrislck>less embarassing code now 🕺
<bjoli>Isn't also one problem that set! implicitly boxes things?
<bjoli>which makes type inference not work properly and all that jazz?
<civodul>wingo_: thanks a lot for the statprof fix, you made my day! :-)
<civodul>wingo_: so the reap-pipes issue is indeed very weird
<civodul>mwette reported it recently: https://lists.gnu.org/archive/html/guile-devel/2020-05/msg00019.html
<civodul>i guess running hooks is quite expensive because they're written in C
<civodul>but i wonder if that's the only explanation
<wingo_>i think that's not the explanation, guile already has some after-gc hooks for other reasons i think
<wingo_>i think that hook is somehow busted; not sure tho
<civodul>oh and i had forgotten that 'syntax-source' is written in terms of 'source-properties'
<civodul>no wonder we're putting pressure on source-whash
***wingo_ is now known as wingo
<wingo>yeah would be nice to have a better reader!
<terpri_>bjoli, i used to write tiny sets of lisp primitives in c and used it for all my cs homework (ignoring gc, etc.)
<terpri_>probably looked very strange to my professors, but i never got a complaint about it :)
<wingo>nice :)
<ahungry>Sounds a lot like https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule
<dsmith-work>wingo: What's with the reader?
<wingo>dsmith-work: would be nice if it returned datums + source location info
<wingo>instead of datums + noodling around with weak source location table
<civodul>wingo: there could be a "source" slot in syntax objects, just like for tree-il
<nixfreak54>Does anyone have articles , tutorials on how to use guile for everything especially replacing it with bash scripts ? I'm looking for a language that I can script anything with , sort of like python
<justin_smith>nixfreak54: I've thought about using this more, but haven't yet done so in anger https://github.com/ChaosEternal/guile-scsh/blob/master/docs/cheat.txt https://github.com/ChaosEternal/guile-scsh/blob/master/examples/guile-scsh.scm
<justin_smith>also this doc https://github.com/ChaosEternal/guile-scsh/blob/master/USAGE
<nixfreak54>sweet thanks justin_smith
<nixfreak54>why in anger though , just curious
<justin_smith>nixfreak54: oh, that's an idiom / saying
<justin_smith>it just means "this looks cool, I tried it, but haven't used it enough to really judge it"
<justin_smith>in other words, I used it for fun, but didn't have a reason to be angry at it yet :D
<dsmith-work>"in anger" could be translated "in production".
<bjoli>wingo: there has to be more or less portable readers available, no? Or is one of the catches that it has to be in C?
<nixfreak54>alright , well thanks again I appreciate it
***bjoli is now known as manumanumanu
<manumanumanu>the chez reader seems _ok_, and should be a lot simpler once a lot of the chez specific stuff is removed. I don't really understand the licensing stuff, though.
<civodul>manumanumanu: i think there'd have to be an implementation in C
<civodul>earlier wingo suggested that it could be Scheme code "transpiled" to C
<ArneBab>I’ve been unable to guix pull for two months now — recently started upgrading directly from a git clone. Do you have a hint how I can fix that?
<ArneBab>$ LANG=C guix pull
<ArneBab>Building from this channel:
<ArneBab> guix https://git.savannah.gnu.org/git/guix.git 790ada9
<ArneBab>s …
<ArneBab>building /gnu/store/kmzfd8avp1qskknh4z62birwvdja9ixy-module-import-compiled.drv... 4% [##### ]builder for `/gnu/store/kmzfd8avp1qskknh4z62birwvdja9ixy-module-import-compiled.drv' failed with exit code 1
<ArneBab>damn… wrong channel, sorry!
<manumanumanu>chrislck: your work on the gnucash codebase is amazing. I suspect it has gotten faster as a result.
<manumanumanu>So many small things must add up
<manumanumanu>regarding match: i have the pattern (name . children), and I want to check name against a predicat. Is that possible with the (? pred? name) way?
<manumanumanu>ie: i want to match a (name . children), but only if name satisfies a predicate
<rekado>manumanumanu: yes, this should work
<rekado>this will not match: (match '(12 "world") (((? string? name) . rest) name))
<rekado>but this will: (match '("hello" "world") (((? string? name) . rest) name))
<mwette>(match '(name . "value") ((? (lambda (p) (symbol? (car p)))) #t) (_ #f)) => #t
<mwette>I like rekado's better.