IRC channel logs


back to list of logs

<ArneBab>wingo: thinking of lilypond with their reliance on a fast reader: Is it possible to turn off all advanced features of the scheme-reader to just get maximum speed?
<apteryx>hello! Is it possible to match child nodes without specifying their parents in an sxml-match pattern?
<apteryx>ah, maybe by using recursion
<apteryx>the so-called catamorphism feature of sxml-match
*apteryx tries
<apteryx>ah, fun:
<apteryx>but recursing this way doesn't seem to be a good replacement to SXPath, which I'm now reading on
<spk121>wingo: any concerns with me pushing mini-gmp (off by default)?
<wingo>spk121: if off by default, no concerns at all
<wingo>u r a hero
<spk121>OK cool. Tonight then
<morganw>May I ask, are there any CI systems building off of release or development branches?
<civodul>spk121: yay!
<wingo>morganw: that would be nice :) in practice there are downstreams doing that (debian, guix, etc)
<wingo>but not off master, i don't think
<civodul>we should restore that
<morganw>wingo: is that because of lack of resources to setup or run them, or for more technical/organisational reasons?
***Noisytoot is now known as impostor
<wingo>it used to be that it took a lot of resources to build guile every time it or one of its dependencies changed; we used nix's hydra
<wingo>but guile builds faster these days and so that is less of a concern. more that gnu itself doesn't host such services
<wingo>so we have to build it downstream somewhere
<wingo>and we don't use something like github or whatever that would have it set up already for us
<wingo>but otoh, the guix technology is pretty good and getting better, so i reckon that's the right place to do it
<morganw>I've never been quite sure whether is specific to guix itself, or available for use by other GNU projects that could build using guix.
***impostor is now known as Noisytoot
***rekado_ is now known as rekado
<rekado>morganw: that is an old name for, which is for building the collection of packages offered by Guix.
<morganw>it seems confusing to refer to the build system and instances under a single name
<morganw>But either way, I think Guix is Linux only so that probably means that you cannot do builds for other platforms unless cross-compiling (maybe that is OK for Windows though)
<dsmith-work>Hey Hi Howdy, Guilers
<roptat>hi! I'm looking for more info on the bootstrap status of guile. I think civodul mentionned the macro expander was not bootstrap? do you have more info on that?
<wingo>well -- module/ice-9/psyntax.scm is the expander. it's written already in the language that has syntax-case. so to load it, we have a pre-expanded version of the expander in module/ice-9/psyntax-pp.scm -- every time psyntax.scm is changed, we have to regenerate psyntax-pp.scm
***spk121_ is now known as spk121
<wingo>i.e. we load ice-9/psyntax-pp.scm when bootstrapping. but later when all of guile is compiled, we load the compiled version of psyntax.scm instead of the compiled version of psyntax-pp.scm
<roptat>so, that would be the only pre-generated source file in guile?
<roptat>and it's only used to build itself?
***sneek_ is now known as sneek
<rlb>wingo: I'd imagine this might have already been considered, but while poking at the utf-8 question a little I realized one option would be to just switch wide strings to utf-8, and narrow strings to ascii, and then we'd keep fixed-width in some common cases with utf-8 content everywhere.
<roptat>wingo, thanks by the way :)
<rlb>(And of course, we might or might not want to change the name "wide" -- I mean some of the chars there would be wider than others :) ).
<roptat>wingo, since I'm interested in bootstrappable builds, I've learned that racket used to have a macro expander written in C. Do you think adapting it for guile would be relatively easy?
<roptat>or maybe it could be done from mes?
<leoprikler>what's with this assumption, that "wide strings == UTF-8"?
<avp__>Hello Guilers! seems to be down, but still refers to that page.
<leoprikler>davet's pages are all in a pretty sad state, sadly
<avp__>FWIW, I'd love to give Haunt a try. There's also Artanis, but it might be an overkill for some tasks.
<davexunit>that link you're trying to use hasn't worked for a long time and will not be restored.
<morganw>The git repository link on that page seems to go to an empty cgit site.
<davexunit>my cgit setup stopped working recently and I'm not sure why, sorry.
<davexunit>all official release tarballs are still available
<wingo>good evening :)
<avp_>davexunit: Oh, it seems that after 'make install' (haunt reader commonmark) is missing from '/usr/share/guile/site/2.2/haunt/reader'
<avp_>There's only 'texinfo.scm'
<avp_>Ah, I see. This module only available if Guile-Commonmark is installed in the system.
<davexunit>avp_: yup, that's it.
<avp_>davexunit: I'm trying to follow your basic Haunt example, but now I'm getting 'invalid metadata format: ""' error on 'haunt build'.
<avp_>I'm using guile-commonmark-0.1.2 on Ubuntu GNU/Linux
<davexunit>sorry, I can't help there.
<avp_>Never mind, I found the source of the error. I mistakenly pasted an empty string at the top of the metadata part in ''.
<davexunit>perhaps the docs are out of date. I haven't looked at this code in almost 2 years.
<davexunit>ah, glad you found it.
<avp_>Thanks for help. ;-)
<davexunit>I'm pretty useless at the moment ;)
<avp_>You wrote the Haunt, that's a big deal on its own.
<davexunit>thanks :)
*wingo pondering how to wire up read-in-scheme to primitive-load
<leoprikler>primitive-load-in-scheme 😉️
<leoprikler>Guile 4 will have scheme-in-scheme bootstrapped from Mes.
<apteryx>is someone familiar with Guile's sxml module? The doc is sparsed and I'm struggling to figure out how to do some xpath selector.
<wingo>sxpath is waaaay underdocumented
<wingo>there are a couple old papers about it that are the best documentation
<apteryx>:-) will try to find them out, thanks for the suggestion
<apteryx>one thing that I can't seem to do is an equivalent to 'findall' as found in Python's xml libraries; something that fully recurses the tree matching on some predicate.
<apteryx>re-reading the Guile Reference manual perhaps that'd be node-closure
<apteryx>oh yes, that seems to be it
<manumanumanu>apteryx: I just fought with it! What are you trying?
<manumanumanu>I was pretty bummed about expanding one pre-post-tree to several elements. There seems to be no way to splice the results, instead of ending up with ((double lists)). That conflicted with something I had to do further down the line. I was able to work around it though.
<manumanumanu>* one element to a list of elements.
<manumanumanu>apteryx: John Clements is a saint, and did quite fine docs over here for the racket port of sxml:
<manumanumanu>so something like '(// element-to-find)
<apteryx>manumanumanu: what I`m trying to do: match all the `div` node which have the element id starting with "#lic-"; here's how I can get it by specifying the full path: ((sxpath '(html body div div div section h2 div)) sbody) -> ((div (@ (id "#lic-0")) "Some text")); but I'm trying to do the same without having to rely on the fixed path.
<apteryx>thanks for the link!
<manumanumanu>jbclements is a saint
<apteryx>manumanumanu: nice, the 3rd example is what I'm after if it works the same in Guile
<manumanumanu>it should be
<apteryx>hmm sadly it seems not: ((sxpath "//p[contains(@class, 'blue')]/text()") '(*TOP* [...]) -> In procedure car: Wrong type argument in position 1 (expecting pair): "//p[contains(@class, 'blue')]/text()"
<apteryx>OK, it doesn't like the string pattern. If I split it into a list like this: ((sxpath '(// p)) ... it returns all the p nodes, which is already something.
<manumanumanu>why not just filter all div elements and then filter using srfi-1 filter? :D
<manumanumanu>good night!
<apteryx>hehe, good night!
<rekado>apteryx: can you share an example data structure you’re working with?
<rekado>I have performed a fair amount of sxpath abuse in the past
<apteryx>I'm using htmlprag to convert the html to sxml of this page:
<apteryx>it looks like this:
<apteryx>then I want to extract the list of licenses
<apteryx>basically, I need a filter that matches 'all the div nodes with id element whose values starts by "#lic-"'
<rekado>uhm, the paste says “The page you are looking for does not exist.”
<rekado>but that’s okay, I use (call-with-input-file "the.html" html->shtml)
<rekado>apteryx: is this what you want? —> ((sxpath `(// (div (@ id ,(filter (lambda (value) (string-prefix? "#lic" (cadr value)))))))) shtml)
<rekado>it returns ((div (@ (id "#lic-0")) "BSD-3-Clause")) for the given page
<rekado>or if you just want the license name: ((sxpath `(// (* (@ id ,(filter (lambda (value) (string-prefix? "#lic" (cadr value)))))) *text*)) shtml)
<rekado>though perhaps it would be clearer if you matched on the “License” class instead
<rekado>like this: ((sxpath `(// (* (@ (equal? (class "License")))) h2 // *text*)) shtml)
<rekado>the documentation really misses a key explanation: the meaning of parenthesis inside a path expression
<rekado>I had to look at the test suite to be reminded of it
<rekado>without the sub-expressions you would merely drill deeper and deeper into a node; you wouldn’t be able to match on children of a node of interest.
<rekado>apteryx: in the first solution I’m using “filter”, which takes a “node” — it’s always (id …), so I’m using cadr on the value to work with the id string.
<rekado>in the last solution I’m using the built-in “equal?” which takes a node (such as “(class "License")” and compares it with the incoming node at this level.
<rekado>once I actually got a node with any tag (*) that has (class "License") among its attribute set I continue to drill into *that* node (and not its attribute set) with “h2”, followed by any text node.
<rekado>if you left off the “h2” you’d also get surrounding whitespace (unless your html->shtml invocation filtered it)