IRC channel logs

2026-09-14.log

back to list of logs

<old>rlb: that assume english language no? I don't mind, but we should offer support for interpreting the bytevector as some other language
<old>not sure if that make sens to you?
<old>maybe I've misunderstood
<rlb>old: this is for some cases where we have no information about the correct encoding (e.g. where the specified encoding failed -- see decoding_error()), so we'd just be guessing that the bytes might be an ascii superset and showing a bytestring. If we're right, it's just easier to read (and much shorter), and if we're wrong, you just get #u8"\xfe;\xff;..." instead of #vu8(254 255 ...).
<dsmith>rlb, Is there a way to display a byte{vector,string} and hex instead of decimal? That is (FE FF) instead of (254 255). Without the noise of \x and ;
<dsmith>s/and hex/as hex/
<old>rlb: can't we do a best-effort with the port encoding and display unknown bytes literally ?
<tbennett>Hello, what is the idiomatic way to have polymorphism with guile. I'd like to use a fake implementation of I/O for tests purpose. I'm thinking using modules, wdyt?
<old>tbennett: GOOPS
<dthompson>generally you do not want to attempt to replace stuff in modules. the OOP language style of stubbing/mocking doesn't really apply to guile unless you are using GOOPS
<tbennett>Well sorry I should have mentionned that I don't want to use GOOPS for that bc, I'm interested in learning how to do proper polymorphism without OOP features.
<old>with module you can add a shim layer that call to an implementation
<old>I did this for selecting multiple audio/graphic backends for exemple
<old>you do lose some potential for optimization while doing so tho, but that is expected
<tbennett>dthompson: by modules, what I had in mind is to have, let's say, two modules that both expose the same functions, one that do the I/O stuff using guile API, and another that do stuff with strings instead because I want to test the returned strings. In my code I would have only call to my abstractions, will be loaded either the string or the "real". That's my plan anyway, but I'm wondering how experienced Guile deve
<tbennett>loper do.
<tbennett>old: thank your, I didn't know about shim layer! It looks close to what I have in mind, intercepting calls seems overengineering for my case.
<old>you could intercept call. I have a "advice" emacs-like layer in BLUE. however, it will not work if some function are inlined by the compiler
<old>anyway, better stay away from hack if you want something robust. But for testing purpose? I think it is fine to use advice
<lechner>tbennett: Hi, this is how I provide machine-dependent implementations at runtime. Maybe you can adapt the logic for your purposes. https://codeberg.org/lechner/guile-linux-cdata/src/commit/bf906bfcdb793b96e776fde1e9a69a9fd84e0379/scm/linux/cdata.scm#L19
<tbennett>old: ty, I totally agree with you about hacks and robustness. I'm looking for hacks but ways to implement software design technics and patterns using tools I'm not comfortable with (yet)
<tbennett>lechner: ty, I'll check it out
<dthompson>imo using module introspection for this purpose is a big hack
<dthompson>this would be better accomplished with procedure arguments for the interchangeable parts or, in the case of I/O specifically, using a string port instead of a file port, etc.
<lechner>sneek: later ask dthompson: What would that look like, please? I don't think I have that option because Nyacc generates my implementations. The functions that are actually available (and their signatures) are not consistent between architectures.
<sneek>Got it.
<old>this is a really neat Python package: https://asv.readthedocs.io/en/latest/index.html
<old>I think I will make that for Guile
<ekaitz>old: how would you approach it? manipulating the VM?
<sneek>Welcome back ekaitz, you have 1 message!
<sneek>ekaitz, ArneBab_ says: I also think nlnet would reject LLM generated works. That the copyright state isn’t clear should be enough for that. My note was about *also* keeping away from LLMs for the proposal.
<ekaitz>ArneBab: old convo but: just for anyone who wants to apply for the next call (deadline November 3rd) https://nlnet.nl/foundation/policies/generativeAI/
<old>ekaitz: for what? (VM)
<ekaitz>old: the python package you shared
<old>ahh
<old>no need?
<ekaitz>there are many ways to benchmark
<ekaitz>that's why I asked
<old>ah. But really it's just a matter of measuring time to execute a thunk I think
<old>that's the most general measurement
<old>after that, there's the measurement of GC allocated mememory, peak allocation, time spent in GC, etc.
<ekaitz>i mean you could also fake everything with macros I guess
<ekaitz>maybe not gc
<ekaitz>but the defines could inject some stuff in the middle
<ekaitz>idk
<ekaitz>i'm really interested on this for mes
<old>what you are describing is to measure call to functions outside of a benchmark?
<old>like my idea is that you say: measure execution of calling THUNK
<old>but you would like to measure the execution of some function X that is internal and not exposed?
<old>but for a more general tracing approach, we probably want an instrumenter inside the VM
<ekaitz>maybe I was thinking just in a more general tracer that gives granular information
<ekaitz>idk how interesting a not-very-granular profiler is
<old>profiler are not tracer tho
<old>adding a low-lever tracer in the VM could be interesting tho
<old>we already have one, but it's not very effective I found
<dthompson>sneek: hi
<sneek>dthompson, you have 1 message!
<sneek>dthompson, lechner says: What would that look like, please? I don't think I have that option because Nyacc generates my implementations. The functions that are actually available (and their signatures) are not consistent between architectures.
<dthompson>lechner: I was online btw. I don't quite understand the question.
<avv>yayyy i got my language working like i wanted it to!!
<avv>learning the compile tower internals of guile scheme is not for the weak lol
<avv>:))
<TheTaoOfSu>Oh you made your own language run on the Guile VM?
<avv>yeah exactly
<avv>it's called generic scheme, or for short, gs. Every function is generic and every call is a multi-dispatch over its argument types
<TheTaoOfSu>Very nice
<TheTaoOfSu>That would be pretty cool to do, but I don't know that I have the patience to dig into the compiler internals that deeply
<TheTaoOfSu>Congrats on the accomplishment
<TheTaoOfSu>You probably know a good bit more about the compiler side of things than most Guile users now lol
<avv>Thank you!
<avv>I sure do lol
<TheTaoOfSu>Certainly a whole lot more than me. I'm just learning Scheme and Guile, so the idea of diving into that already gives me a headache lol
<avv>I made it cause I like it better if functions are, per say, verbs on objects. But every object is different yk, so every object display's its own way, adds it's own way, etc. It's actually very mathematical (if you can call it that), I'm a math major after all so
<TheTaoOfSu>Makes sense
<avv>TheTaoOfSu: oh it's cool that you're starting
<avv>I found scheme very dense at first, but then, after a while, i got used to it. Now every other language feels like so much boilerplate lol :P
<avv>Especially C-like languages
<avv>Oh my god
<avv>TheTaoOfSu: why are you learning it?
<TheTaoOfSu>Eh, I already passed through Haskell and Common Lisp, although I didn't really work with them much at all, so those gave me familiarity with some important concepts
<TheTaoOfSu>I liked the purely functional aspect of Haskell a lot, and I took an interest in Lisps, so Scheme seemed like an interesting balance of the two
<avv>Oh yeah makes sense
<TheTaoOfSu>Guile is mainly just because of library availabilty. I want to make some simple stuff for mobile Linux, which means I need bindings to one of just a few GUI toolkits, and Guile is pretty much the only one with G-Golf
<avv>It's a nice language too
<TheTaoOfSu>Yeah, I like it so far
<avv>I mean, Scheme, not necessarely Guile itself
<avv>like i find it funny how it's (define (f x) ...)
<avv>Cause later, you call it with (f x)
<avv>so it's like.... defining the same way it's being called
<TheTaoOfSu>I wanted to make the core of my app an R7RS library so other people could use it, but turns out it's really hard to make things implementation-independent once you get much complexity
<avv>Yep 100% true
<TheTaoOfSu>Not like I expect a ton of users for a small web protocols library, but still, I think you should put at least a little effort into making libraries flexible
<avv>Which one?
<TheTaoOfSu>I want to make a library to cover a lot of the most common ones. Gemini is the obvious choice, Spartan is like an even more simplified version of that, maybe Gopher but I haven't looked at the spec to see how reasonable that is yet
<TheTaoOfSu>The goal is a browser that covers an array of small web protocols
<avv>Ah ok. Sounds fun to make!
<avv>Could be scriptable too
<TheTaoOfSu>Most are really simple. Like there's Nex that you can actually use from a standard terminal simply by netcat'ing the URL and sending a path
<TheTaoOfSu>So I think most of the work is really going to be in giving it a decent UI, adding extra features people expect from browsers like bookmarks, etc.
<avv>Mhm
<TheTaoOfSu>Yeah, I think it'll be a nice intro to a lot of the things I need from Scheme
<avv>Not easy with Gtk lol ngl
<avv>but it does work!
<old>avv: have you seen my replied? https://codeberg.org/guile/guile/issues/272
<avv>Hi, yes I did
<old>did it helps?
<avv>Sorry I only cloned guile a few minutes ago Xd
<TheTaoOfSu>Yeah, well, the alternative is Qt+, which doesn't even have bindings to any Schemes so far as I can tell. At least, none modern enough to have the responsive UI features I'd need
<old>okok !
<avv>i'll apply the patch
<old>you tell me if that fixes yoru issue. Pretty sure it does. I will need to find a way to avoid recursion in module variable resolution
<avv>TheTaoOfSu: yeah that's what's great with gtk. it's easy to port, thanks to the protocol and stuff they publish
<avv>old: I'll check
<TheTaoOfSu>avv: I think one thing that helps is they've kept themselves to C. It seems like C bindings are easier to make. Like there's not much in C++ with Scheme bindings, which is part of why Qt+ isn't really an option
<avv>Very much true
<avv>i still think not watching will make something compile faster
<avv>it does not
<bremner>that's why hpc is all batch mode
<avv>it'd be nice to have a wayland (or x11 if it matters so much) floating window manager, but written and configurable in guile. I know one exists, but i had problems with it.... i think it was called wlgl or something
<rlb>old: sure wrt best effort, sure, if we don't want to produce something you can read back in, unless, of course, we do eventually settle on and add something like the noncharacters proposal. The latter is more or less what you're describing I think. Though note that the data we're working on is a bytevector, not a string (yet).
<rlb>s/, sure,/,/
<avv>TheTaoOfSu: hey, if you care, you could make a repo. I'd love to get my hands dirty too on such a project :)
<avv>old: it's still compiling lol
<rlb>JohnCowan: the noncharacters wiki page link broke, and then I found it renamed. Then I noticed https://codeberg.org/scheme/r7rs/issues/322#issuecomment-21647270 Related?
<daviid>TheTaoOfSu: someone wrote (started to at least) browser using g-golf and WebKitgtk (iirc), it's clled nomad. It's in guix, but unmaintained afaict, still uses guile-2.2 and hasn't been updated wrt GNOME involved upstream libs .. But it might be easy to make it work with the latest gule, and GNOME libs ...
<daviid>ah, it was in guix, it's been removed
<avv>but webkit is for standard html no? Here, they're proposing a browser for purely (almost) text protocols
<avv>daviid: .
<rlb>dsmith: I don't think so, if we want to be able to read the bytevector back in as a bytevector. Assuming you meant a bytevector written with a different element base (hex, etc.).
<JohnCowan>rlb: No. R7-small allows characters whose integer values are greater than #x10fff. #322 removes that (a minor backward incompatibility)
<avv>old: yep it's fixed!
<lechner>dthompson: For some reason, my new client and bouncer, Goguma and Soju, report that you are no longer in this channel. I was just hoping to see whether I could adopt your idea but had trouble picturing how to do it.
<daviid>it should be here https://savannah.nongnu.org/git/?group=nomad - but this gives a 502 ... - the doc url works, here https://www.nongnu.org/nomad/manual/html_node/index.html#Top
<JohnCowan>Currently Chicken supports them, but that's it
<dthompson>lechner: regarding testing?
<lechner>dthompson: no, regarding my reflection hack
<daviid>this url works as well https://www.nongnu.org/nomad/
<daviid>avv: but still, it is using guile, g-golf ... worth looking at I think ... my 2c
<JohnCowan>non-Unicode chars are not the same as Unicode noncharacters
<rlb>Right. Why did the link break (was renamed)?
<dthompson>lechner: I don't think I really understand enough to comment but in the link you shared I wonder if you are doing something at runtime that should be happening at compile time
<rlb>old: and if it matters, note that this was just for some error messages that currently ~s write the bytevector. I'd thought for many cases (anything that's an ascii superset), bytestrings might be nicer (of course not nicer for UTF-16).
<TheTaoOfSu>avv: Sure, I'll try to whip something up in a bit, probably on Codeberg. I have a personal forgejo I'm using, but there's nothing really there yet. I just yesterday accepted the fact I'm going to have to give up on general R7RS for even the base library and fully embrace Guile, so I don't even have basic dependencies sorted yet
<TheTaoOfSu>I'm gonna try to get the protocols library started first, at least a couple to give the full app something to work with
<TheTaoOfSu>daviid: I can't find nomad in the Guix packages list. Maybe got removed? I'll see if I can find it on google
<daviid>TheTaoOfSu: yes, it's been removed, see the other urls I posted
<lechner>dthompson: I'll give that some thought. For the moment, I look at the machine type at runtime, so your suggestion is valuable.
<TheTaoOfSu>Ah, yeah, that's what I just found. Guess I should have looked a little closer at the chat logs
<TheTaoOfSu>Thanks, daviid, I'll check it out
<TheTaoOfSu>Oof, no updates in 7 years. That's a shame
<TheTaoOfSu>Seems sort of like a Scheme version of Nyxt, which uses Common Lisp
<daviid>TheTaoOfSu: I would also look at the epiphany-browser (some of) code, the GNOME web browser code, at least how they defined the ui ..., which is done in separate .ui files ...
<TheTaoOfSu>That's a good idea
<rlb>JohnCowan: oh, and if it wasn't important that the page not be at the old location, I suppose a symlink might allow previous references to continue to work (if symlinks can be created there). Dunno. (It wasn't too hard to find because codeberg just dumps you into the directory for the missing page.)
<avv>TheTaoOfSu: can you share your codeberg profile? So that I know when the repo is created. Otherwise I won't know xd
<avv>i'll drop a follow
<TheTaoOfSu>avv: I apparently never made one, so I'll do that now, aaaaaand here you go https://codeberg.org/TheTaoOfSu
<TheTaoOfSu>I need to look into how to mirror things from my Forgejo instance. I know I've seen a manual page on it, but I never got around to it, or to setting up CI... Anyway, I'll try to figure out mirroring soon. I have an empty repo made, but I haven't started adding to it since I've been figuring out dependencies and stuff
<avv>TheTaoOfSu: ok gotcha
<old>avv: great
<sneek>Welcome back lilyp!!
<JohnCowan>rlb: if I did that it was by accident
<rlb>OK, well I believe this link used to work: https://codeberg.org/scheme/r7rs/wiki/Noncharacter-error-handling
<rlb>Now it just goes to the parent dir.
<rlb>But the content's still in https://codeberg.org/scheme/r7rs/wiki/INoncharacter-error-handling
<rlb>i.e. now there's an "I" prefixed.
<JohnCowan>fixed I think
<TheTaoOfSu>avv: I got a repo mirrored. I think I may try to rework how it's done, but I think I should be able to do whatever I need without replacing that. Need to figure out how I'm going to mirror back the other way... Would be ideal to get issues and everything to port over
<TheTaoOfSu>Actually, isn't Forgejo implementing ActivityPub? I bet there's a better way to do this...
<rlb>JohnCowan: looks like it --- thanks.
<daviid>TheTaoOfSu: https://apps.gnome.org/Epiphany/ and https://gitlab.gnome.org/GNOME/epiphany
<daviid>unlike i said, thery don't use template/ui files to design, so fwiw, the _EphyWindow subclass is defined in ephy-window.c, starts line 153 - but not usingui files amd templates makes it quite a lot more dfficult for newbie to study their code ...
<TheTaoOfSu>Thanks for pointing me in the right direction, daviid
<PuercoPop>When writing a macro in the style of with-foo* bindings* where bindings* is similar to the let's ((var val)...). Is there a way to collect the variable name symbols? I want to expand to a check that everys that at least one of them is not `null?`
<dthompson>PuercoPop: you would need syntax-case for this. be careful with checking against bare symbols, though, because the meaning of 'null?' depends on what's in scope at the macro expansion site
<cow_2001>how much of latex-like stuff can you do in skribilo?