IRC channel logs

2021-03-18.log

back to list of logs

<mwette>lispmacs: tree-fold, as in (sxml fold) and https://wingolog.org/pub/fold-and-xml-transformation.pdf
***sneek_ is now known as sneek
***apteryx is now known as Guest64152
***apteryx_ is now known as apteryx
<wingo>rlb: looking at it again -- what happens now if you write a wide char into a narrow SH_STRING ?
<wingo>am wondering how all views onto that stringbuf would get updated
<janneke>hmm, my guile-websocket make check fails with 3.0.5
<wingo>rlb: evidently it works tho :)
<wingo>ah no, i am mistaken. seems (substring/shared s 0) just returns s, as an "optimization" i guess? wtf
<janneke>how do i run one srfi-64 test?
<janneke>hmm, or even find out which one fails?
*wingo does not know
*janneke goes to bisect
<janneke>the backtrace is probably better if the test were compiled
<janneke>hmm, it seems that this doesn't work anymore in 3.0.5
<janneke>(exit (= (test-runner-fail-count (warn "current"(test-runner-current))) 0))
<janneke>hmm...it was a feature
<janneke>Fix bug #42713: srfi-64: Reset test-runner-current if done
<civodul>i disovered Gitile by roptat -> https://git.lepiller.eu/
<civodul>the ultimate thing for those who want all-Guile services :-)
*janneke resets wip-mingw again with nicer fix for cross-compile bug
<wingo>janneke: yeah that one should have had more NEWS noise
<wingo>civodul: nice!!
<janneke>wingo: np, it was easy to fix -- i still need to become friends with srfi-64 ;-)
<wingo>rlb: ah yeah, SH_STRINGs already point to another string. ok, no problem
<wingo>rlb: so relative to current status -- stringbufs would have the byte indices. strings themselves stay the same i think relative to current status -- SH_STRING or normal string. is that right?
<wingo>and stringbufs would hold total byte count and have an index appended (one byte per each N codepoints or so indicating how many bytes that segment takes)
<wingo>where N is i guess floor(256/6) or so. could make the index be a uint16_t, maybe; dunno if dividing by 42 can be optimized to a multiplication :P
<wingo>could have a multi-level index for big big strings. but that would be an optimization that could come later
<rekado_>oh, gitile is written in Guile, I didn’t realize when I first heard of it.
*rekado_ goes to replace the default perl thing on git.elephly.net
<janneke>ugh, 8sync has the same srfi-64 problem
<rekado_>janneke: I had to remove that line in at least one package when building with Guile 3.0.5 (guile-commonmark, it’s already fixed in the upstream repo)
<janneke>rekado_: yeah, i'm moving (test-exit) inside/before (test-end) for 8sync
<manumanumanu>ahoy hoy!
<ArneBab>wingo: from Lilypond there’s te question whether it would be viable to make the reader-rewrite reason to move to 3.2 — what do you think?
<wingo>there's always a tradeoff for changes within a stable branch vs starting a dev branch. what is the argument?
<wingo>if we start a dev branch, then i do no more work on 3.0
<wingo>i can't do both
<wingo>as there is no incompatibility, afaiu, i see the balance as favoring continuing to work in 3.0 as long as possible
<ArneBab>Just found: https://idiomdrottning.org/fancy-defines — I didn’t know about (define ((add a) b) (+ a b)) (map (add 3) '(1 3 6))
<ArneBab>wingo: the argument is worries about stabilitiy, my answer was that as long as there’s full compatibility, we need no new minor release. Only if there should be a reason to favor 3.0.6 over 3.0.7.
<manumanumanu>ArneBab: there was a SRFI released about that recently, iirc.
<manumanumanu>219
<manumanumanu>the srfi source is amazing. A three-clause syntax-rules macro.
*janneke found a GOOPs problem trying to upgrade 8sync to guile-3.0
<jlicht>Does anyone know of a guile/scheme library similar to clojure's garden? I would describe it inaccurately as sxml-for-css
<davexunit>jlicht: I don't think so. I've looked for something like that before and even thought about building it myself but never did.
<janneke>davexunit: i have some patches for guile-websocket over at https://gitlab.com/janneke/guile-websocket, just updated for guile-3
<davexunit>it's an interesting topic. I've been working on a set of exercises from a book about creating a combinator language and compiler for regular expressions. writing something for CSS would be like a much bigger version of this. :)
<davexunit>janneke: neat. thanks.
<davexunit>I haven't looked at this library in a long time.
<davexunit>janneke: pushed all your patches to my repo. thanks again!
<dsmith-work>UGT Greetings, Guilers
<janneke>davexunit: oh great, thanks :-)
<roptat>rekado_, :)
<davexunit>janneke: what do you use this for? I wrote this library for fun many years ago but never did a proper release or anything.
<davexunit>I didn't expect people to actually use it ;)
<roptat>rekado_, if you really want to use it, I have a service definition: https://git.lepiller.eu/system-configuration/tree/-/modules/services/gitile.scm
<davexunit>perusing the code again and I'm quite pleased with myself. pretty clean with good references to the spec! lol
<janneke>davexunit: i'm playing/test with 8sync atm
<jlicht>davexunit: tbf, I would mostly want to manipulate s-expressions instead of mucking around with SASS/LESS, so a 'proper' library might even be overkill. Which book do you happen to be reading?
<davexunit>jlicht: software design for flexibility. new book from one of the SICP co-authors.
<civodul>jlicht: there's https://nongnu.org/scss/ (i haven't tried)
<davexunit>ooooh
<civodul>roptat: could you contribute that service definition to Guix? :-)
<ArneBab>wingo: some time ago you made it posssible to do definitions after expressions in functions. Could that also be done inside non-function defines? ⇒ (define (foo x) (display x)(define 'bar) bar) works. Can we get (define foo (newline)(define 'bar) bar)? Would that then be compile-time execution?
<davexunit>civodul: looks pretty basic, which is still more than I knew was available.
<jlicht>civodul: the documentation is a bit terse, but it might do the trick! Thanks :-)
<davexunit>sass/less are their own languages that add some significant improvements for the humans writing stylesheets.
<davexunit>a good s-expression -> css translator should cover up the warts of css and allow for easier abstraction
<roptat>civodul, at some point :)
<janneke>davexunit: in 8sync, we wrote some more frame fragment handling code, sending/receiving fragmented frames
<davexunit>janneke: if anyone wants to incorporate that into the websockets library directly, I would gladly accept such a patch :)
<janneke>davexunit: right!
<roptat>OrangeShark, ping :) I have a MR for guile-git (sorry for the noise if you received a notification for each change I made, I think it's stable now ^^')
<davexunit>websockets are fun. wish I had a use-case to use them more. I can't even remember why I wrote the library in the first place...
<davexunit>hmm... I think they were rather new at the time and I was using them for a project at work.
<janneke>yes, it's fun to play with guile and a browser using websockets
<davexunit>then somehow I looked at the spec, which was well written, and realized it wasn't all that complex.
<pkill9>cool civodul
<pkill9>that would be good with huant
<pkill9>haunt*
<pkill9>my blog has an scss file
<pkill9>I'm not sure how to have haunt call an external file on rebuild so I can generate the css file each time
<pkill9>but a native solution would be even better
<roptat>pkill9, I think you just need a builder for that css file
<roptat>which for haunt is a function that takes some arguments (I don't remember which exactly, but I think it's documented, or at least not too difficult to find out from existing builders)
<davexunit>I don't remember either, but if it's not documented I'd sure accept a patch to document it ;)
<davexunit>another one of my projects I haven't give much attention to in a long time
<davexunit>I have patches sent to me going back to 2019 :| oopsies
<davexunit>I will put out a haunt release... eventually
<pkill9>the builders return something produced by make-page, I'm wondering how it decides where to place these pages
*civodul cheers davexunit
<davexunit>pkill9: pages have a file-name field that says where they go
<davexunit>so they're pretty low level.
<pkill9>so i assume that the builders use a record
<davexunit>builders are just procedures, actually
<davexunit>they take 2 arguments: a <site> object (the thing that has all the site-wide config), and a list of posts
<pkill9>ah ok, so builders arne't what I would need for this
<pkill9>seems builders are tied to pages
<pkill9>there's a procedure for static files
<davexunit>builders aren't tied to pages
<davexunit>builders return pages or assets
<pkill9>but if they take a list of posts, then how can you use them for non-post objects?
<pkill9>ok
<davexunit>pages and/or assets, I should say.
<davexunit>those are the 2 primitive, low-level data types
<davexunit>an asset is just a file on disk that will be copied verbatim
<davexunit>a page is something that is programatically generated and serialized to a file on disk
<pkill9>ahh there is a make-asset procedure
<pkill9>which you can use to specify source and destination
<davexunit>yup, that's all there is to that.
<davexunit>use it for images and stuff
<pkill9>so i could make a procedure that calls sass or whatever and outputs to /tmp, then calls make-asset using that /tmp/css file
<davexunit>I wouldn't recommend that.
<davexunit>assets are for files that need no processing
<davexunit>it's a bit hacky, but pages would be more appropriate for this.
<pkill9>but the CSS file is an asset, not apage
<davexunit>but the css file isn't being copied verbatim, right?
<pkill9>it will be, after I call scss to the scss file
<pkill9>which will generate a css file, which then gets copied verbatim
<davexunit>I wouldn't consider that an asset
<davexunit>because it's a derivative of another file
<pkill9>hmm ok
<pkill9>I suppose it makes more sense of rnow just to generate it outside of haunt
<pkill9>for now*
<davexunit>haunt should be the thing taking care of processing something and writing it to the proper destination
<davexunit>I generate all of my site's code with scheme, not external tools, so there isn't a ready-to-use solution here.
<davexunit>but the concept of a page fits the bill, if in a sort of hacky way.
<davexunit>the "contents" of a page could be simply the name of the .scss file.
<pkill9>but why would it generate a css file?
<pkill9>if it's a page
<davexunit>and the "writer" procedure could arrange for opening a pipe to sass via (ice-9 popen) and redirecting the output stream to the output port that the writer procedure receives.
<pkill9>oh i see i think
<davexunit>the "page" metaphor kind of falls apart here, which is why I'm saying it's hacky.
<davexunit>but essentially all a page is doing is taking some scheme data and applying a procedure to it, with the expectation that the procedure will use the output port it has been given to populate the destination file.
<jlicht>so page means computed-asset, in most cases?
<davexunit>in haunt an asset means a file copied verbatim, so I would say no.
<davexunit>a page is a programatically generated file
<wingo>ArneBab: cost of a minor release is very low fwiw. if there is a bug in 3.0.6, we'll just make a 3.0.7, no prob
<davexunit>it represents a single file that has an arbitrary program generate its contents
<davexunit>perhaps a future version of haunt could change the name "page" to something more generic, and have all the plumbing for applying an external program and writing the output to the destination file.
<jlicht>haunt-contrib ftw, I guess :-)
<davexunit>I'm just making this shit up as I go ;)
<pkill9>maybe split the the raw-file concept of the 'page' into it's own thing, and rebuild the 'page' to use that
<pkill9>idk
<pkill9>also, that SCSS module is confusing, because it means "Scheme CSS", it's not a reference to the extended css type "scss"
<pkill9>this https://sass-lang.com/documentation/syntax
<pkill9>that said, all the functionality of sass is provided by scheme
<jlicht>It predates scss
<pkill9>it's just amore programmatic form of CSS
<pkill9>ok
<pkill9>you could have an importer of scss (SASS) into scss (Scheme CSS)
<davexunit>pkill9: here's an untested example of what I mean: https://gist.github.com/davexunit/a4d8011b09e0b9c7afc95bc17f14abbb
<davexunit>if sass can't dump the generated css to stdout, then yeah you could use a temp file, but the important thing would be that you had some abstraction that makes all these gross details transparent
<davexunit>I guess transparent isn't the right word, but you get what I mean ;)
<davexunit><verbatim-file> and <generated-file> would probably make more sense as generalized low-level data types.
*davexunit is getting lots of ideas :)
<pkill9>it can dump to stdout
<pkill9>i think actually it only dumps to stdout
<pkill9>you have to redirect it to a file i think
<davexunit>ah okay
<davexunit>well then the code I provided should be kind of what you'd want
<manumanumanu>Is there anything other than the process redirection language that people miss from SCSH?
<manumanumanu>There is a pretty complete implementation of that for chicken that could be ported to guile with ... moderate effort
<davexunit>I've never used it so dunno
<manumanumanu>the egg in question: http://wiki.call-cc.org/eggref/5/scsh-process
<manumanumanu>the repo is here: https://code.more-magic.net/scsh-process
<rlb>wingo: yeah, that's right, though at least at the moment the index "width" is set up to be dynamic, based on the length of the string, i.e. < 256 has a byte width index, < 2^16 has a uint16_t index, < 2^32 has a uint32_t index, etc. And the "stride" is also dynamic, i.e. we'd currently skip 16 chars between offsets for < 256, 32 chars for < 2^16, 64 for 2^32, etc.
<rlb>That allows us to maintain roughly the same index overhead for all strings if we like.
<wingo>coo coo
<civodul>manumanumanu: never used scsh either but Gash provides a bunch of niceties in this area: https://savannah.nongnu.org/projects/gash/
<davexunit>this scsh-process thing is making me wonder: I have chickens, but I don't use chicken scheme nor do the chickens.
<davexunit>something doesn't add up!
<pkill9>davexunit: thanks, that works, how do i output that to the assets subdirectory?
<pkill9>nevermind, i have an example
<davexunit>pkill9: just in case it helps: the first arg is the output file name
*pkill9 wants to make a service similar in goals to wordpress but using haunt
<pkill9>not really sure who would use it though, just would like that to exist
<davexunit>are there any static-websites-as-a-service services out there? I've never looked
<pkill9>there is write.as, not sure of any others
<davexunit>the reason I don't use wordpress or similar is because it's a dynamic web application full of issues
<pkill9>I don't know of any others, that one, and possibly another i heard of, is focused around just content though
<pkill9>yea, heard about it's problems
<pkill9>what I want is something that lets you theme and edit your blog, but produces a static site
<davexunit>static site generators tend to have the drawback that they are for a more technical audience, and haunt is no different.
<davexunit>a friendly UI for one would be cool
<pkill9>yea, I'm not really even sure I'd use it when I can just generate the site and host it myself, I just think it would be cool to have
<pkill9>and I'd make it easy to download/upload the markdown files
<pkill9>wordpress requires a plugin just to export as markdown
<davexunit>a service that separates the task of editing and publishing (dynamic) with the finished product (static) would be good. surely there's something like that already out there.
<pkill9>yea
<pkill9>oh yea this looks like it does that https://getpublii.com/
<davexunit>nice
<pkill9>oh it's a desktop application
<pkill9>here's one i think online https://www.siteleaf.com/
<davexunit>good. now I can happily stay in my niche of "scheme programmers with blogs" knowing that there's more user friendly tools for other people.
*janneke stumbles upon another guile-3.0 thingy
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>goodbot
<apteryx>daviid: by the way, if you need a hand with anything for the next guile-lib release, let me know!
<manumanumanu>civodul: Well, I just think this kind of process handling should be available more easily in guile. Whether it is using EPF from SCSH or something else. It is something that is hard to get right, and that many people want - especially when writing quick scripts.
<manumanumanu>EPF might not be the best idea (I reluctantly admit, since I have used it quite a bit), but something that allows for the power of scsh redirections and process notation would be amazing. I will have a look at gash and see if I can maybe use it as a starting point.
<civodul>manumanumanu: i agree; Rutger contributed 'pipeline' in (ice-9 popen) some time ago
<civodul>i think we could have more of those
<manumanumanu>I saw that and was very happy!
<manumanumanu>I will give porting SCSH-process a try... I will have to make some small changes to the syntax, since it will collide with some other syntax (r6rs | I believe), but most things should be possible to keep intact.
*davexunit figured out how to redirect external program output into an output port
<davexunit>specifically, an output port connected to a file
<davexunit>primitive-fork, then in the child process (close 1) (dup2 (fileno port) 1) (execlp "the-program")
<manumanumanu>had you asked your chickens they would have told you to install the scsh-process egg :)
<manumanumanu>These things are just horrible to debug though. If it doesn't work, at best it just hangs and produces no output.
<manumanumanu>giving you no help whatsoever
<manumanumanu>I remember trying to imlement the pipeline just added to (ice-9 popen) in pure scheme about 8 years ago. I had to give up.
<rekado_>sometimes I want to generate inline JavaScript in SXML, but the entity encoding gets in the way. Is there a way to inject text without having the (web server) machinery change it?
<wingo>yeah somehow. you want cdata i think
<wingo>hmm
<wingo>rekado_: this is what i use https://github.com/wingo/tekuti/blob/master/tekuti/page-helpers.scm#L153
<wingo>NB, produces html, not xml
<wingo>i looked at the living html spec when i wrote that, fwiw
<rekado_>thank you!
<apteryx>seems I'm misunderstanding call-with-values: (define p (lambda (x y) (format #f "~a, ~a" x y))) (call-with-values (values (cons (list 'a "v1.0.2") '()) '()) p) -> Wrong type to apply: ((a "v1.0.2")). Ideas?
<apteryx>ah, the first arg is supposed to be a procedure, not the application of the procedure (or its result)
<apteryx>this works: (call-with-values (lambda _ (values (cons (list 'a "v1.0.2") '()) '())) $17)
<RhodiumToad>right. call-with-values is a bit low-level, the other mechanisms for it are usually preferable
<apteryx>right; the name mislead me :-) This is indeed clearer in this case: (receive (x y) (values (cons (list 'a "v1.0.2") '()) '()) (p x y))
<wingo>define-values is also a good option
<wingo>(define-values (x y) (values 1 2))
<apteryx>neat!
<civodul>or srfi-71 for 'let' bindings
<RhodiumToad>does the fact that define-values expands into something that does set! cause any issues?
<wingo>RhodiumToad: not sure tbh. without heroics from the compiler i can imagine the result is suboptimal
<wingo>we should have a better implementation i reckon
<RhodiumToad>hm. maybe I misread how it expands
<wingo>racket has values-defining forms as primitives afair
<RhodiumToad>it looks like it does a (define t-blahblah ...) that gets a list of values, then a series of (define a (car t-blahblah)) (set! t-blahblah (cdr t-blahblah))
<RhodiumToad>so at least it doesn't do set! on the things it's supposed to be defining, only on the temporary variable
<wingo>yeah exactly. not pretty tho
<wingo>the optimizer could optimize out the vector in (define t (call-with-values (lambda () expr) (lambda (a b c) (vector a b c)))) (define a (vector-ref t 0)) (define b (vector-ref t 1)) (define c (vector-ref t 2)) ...)
<wingo>but that happens late; not available at peval time
<civodul>if it can optimize it out, that'd be a nice option
<wingo>pretty sure that optimizes out; i remember checking (match (vector a b) ((a b) (+ a b))) and it folded as expected
<wingo>er #(a b) for the pattern, rather
<wingo>yeah that optimizes
<civodul>really nice
<wingo>janneke: hey :) what's the mingw64 timeline?
<wingo>i.e. if patches ready for review by monday i would wait for it before making 3.0.6
<wingo>assuming review and landing will take a week
<wingo>otherwise i would release 3.0.6 sooner and follow up sooner after
<wingo>heh, unclear wording
<wingo>anyway i just mean we can make a 3.0.7 within another 4 weeks or so if we want
<wingo>lloda: regarding autocompiling and no source locations -- is that a change relative to 3.0.5 ?
<wingo>davexunit: hey where was your goops patch
<wingo>sorry i keep forgetting things
<daviid>wingo: here https://lists.gnu.org/archive/html/bug-guile/2021-01/msg00028.html
<daviid>apteryx: no need, tx
<alextee[m]>Will the new release finally work with mingw64? \o/
*alextee[m] is patiently waiting for an msys2 package for libguile
<janneke>wingo: i posted to guile-devel this afternoon
<wingo>great tx
<janneke>i'll be sure to ping you here next time ;)
*janneke had a very busy day doing all kinds of guile-3 package updates
<janneke>also, i was hoping that spk121 would glance through my other mingw patches/fixes and cherry-pick some of them
<davexunit>daviid: thanks for sending wingo the link. I was afk
<daviid>davexunit: np, iwas here and with the link in my browser still ...
***edcragg7 is now known as edcragg
<ArneBab>did you receive my email-forwards from Lilypond to guile-devel?
<spk121>janneke: this weekend, after I finally get to Potluck, I should have time to work MinGW. In real life, these have been a crazy busy couple of weeks, phew
*spk121 wonders how life can be busy whilst in a quarantine