IRC channel logs

2024-02-28.log

back to list of logs

<rlb>...very surprised args-fold doesn't (appear to) support --foo value, i.e. requires --foo=value.
<rlb>Seems like an unconventional choice...
<old>rlb: paste?
<old>ahh
<old>--foo value vs --foo=value
<old>right
<old>shame :-(
<rlb>ACTION will just "do something else"
<old>that does not stop me from using args-fold tho
<old>it's very nice
<rlb>This works pretty well in the clj world. Suppose I might eventually consider "porting" it: https://github.com/clojure/tools.cli
<lechner>Hi, can (web server) and (sxml simple) deal with UTF-8 strings?
<rlb>I *never* type --foo=bar, so I'd want my tool to support both at least.
<old>rlb: I understand. might be worth fixing it then
<old>or maybe it is part of the spec?
<rlb>Maybe, though, right -- might require some care, i.e. a non-standard extension or something.
<rlb>Anyway, I'll likely just do it manually for now -- might have ended up there anyway.
<old>rlb: also can not throw an exception in procedures while parsing
<old>this is _really_ frustating
<rlb>Hmm, can't just set up a call/ec prompt and then jump to that? Or maybe that's not sufficient...
<rlb>I'll need to double-check, but it's looked like you can't currently use #:prefix and #:select in the same use-modules statement. I wondered if that was intentional, or incidental.
<rlb>(in use-modules)
<rlb>You *can* do it via two #:use-modules...
<rlb>i.e. this works:
<rlb> #:use-module ((srfi srfi-37) #:prefix args/)
<rlb> #:use-module ((srfi srfi-37) #:select (args-fold))
<rlb>But combining them didn't appear to.
<mange>I would have assumed that they'd both be applied. #:select limits the names that are imported, and #:prefix modifies them, so putting them together would import one name "args/args-fold", right?
<old>lechner: You can use (rnrs bytevectors) or (ice-9 iconv) to encode/decode utf-8 from bytevectors
<old>so my assumption would be yes for (web server), not sure for (sxml simple) since I've never used it
<lechner>old / what are literal strings like this, please? https://codeberg.org/lechner/mumi/src/branch/lechner/experimental-rebased/mumi/web/view/html.scm#L645
<lechner>are they bytevectors?
<rlb>mange: hmm, well in the two-form case, I get what I wanted, i.e. everything prefixed with args/ and a separate binding for args-fold.
<rlb>That was mainly because args-fold is fine, but "option" is too generic in this case.
<old>lechner: no they are string. I'm not sure if guile support literal stirng as utf-8 yet. I've seen some exhange on that lately
<lechner>old / thanks so much! that gives me something to experiment with
<old>lechner: If you want to know more about string in Guile, I suggest the API documentation: https://www.gnu.org/software/guile/manual/html_node/Strings.html
<lechner>yeah, i just hovered over that. thanks!
<old>happy hacking :-)
<lechner>old / the literal is only for testing, it doesn't work with the variable either!
<mange>rlb: Yeah, using two forms means they work separately: one pulls in all the names prefixed, and the other pulls in args-fold itself. I'm just saying that using them together probably does "work", it just doesn't do what you want.
<rlb>Ahh, ok -- ordering.
<rlb>That rings a vague bell now...
<rlb>...possibly also conflating a bit wrt the similar clj form that does do what I expected i.e. (:require [foo.bar :as bar :refer [x y z]).
<mange>Yeah, Clojure's :require semantics are different to :use-modules. Particularly given Clojure's aliases are a core part of how names are resolved, whereas in Guile names are "flat" in each module.
<rlb>Right - prefix is just superficial.
<rlb>(from a clj perspective)
<rlb>I'd be curious if guile's behavior is intentional, though -- i.e. if ordering mattered, then the prefix before the select should have caused a crash, but it could also be that the select is defined to go first. I'd guess though that maybe we just haven't officially specified the semantics, so it might be incidental.
<rlb>Whether or not we could actually consider *changing* it, even if we wanted to is another question :)
<mange>I don't think ordering in the call matters. Reading the manual "(guile) Using Guile Modules" it sounds, to me, like the clauses are processed in this order order: select (to filter), prefix (to rename), then renamer (to rename in more complex ways). I don't think it's super clear, though.
<mange>However, it *does* say: "Note that SEEN is also modified by PREFIX and RENAMER."
<rlb>Interesting, and thanks -- should have found/read that.
<dodoyada>so I noticed with artanis and fibers web server it seems like you're expected to just start the server on the repl process which prevents you from using the repl more. Is that normal, or are you assumed to start a new thread for it? In the clojure world it's super common to have a repl workflow where you would start a server (typically using a component manager), free up the repl, then set up a function to stop the server, reload
<dodoyada>changed namespaces, then start the server again. I keep trying to replicate that, but is it just not how things are done here?
<old>So I was talking about library fuzzing: https://github.com/FuzzAnything/hopper
<old>Looks like somebody did that in 2023: https://arxiv.org/pdf/2309.03496.pdf