IRC channel logs

2023-11-02.log

back to list of logs

<apteryx>haugh: how do I import that define-library syntax? Unbound variable: define-library
<apteryx>r7rs-libraries says it's included from boot-9.scm, which is the first module to be loaded, no?
<apteryx>yeah, I see (include-from-path "ice-9/r6rs-libraries")\n(include-from-path "ice-9/r7rs-libraries") in tEre
<apteryx>there*
<apteryx>I think it's only called when passing --r7rs to guile
<apteryx>I mean, the 'install-r7rs!' that seems to really activate it
<daviid>apteryx: what would be the point to add that srfi if it can't be used in guile 'proper' ?
<daviid>most of us do not use r7rs
<apteryx>I guess to be able to use srfi-209 without users having to use --r7rs, I should rewrite the define-library boilerplate into Guile's native define-module
<daviid>i don't know, wanted to ask ... maybe one can have their modules 'just' using guile, r6rs, goops ... and still '#:use-module (srfi srfi-209) and use its functionality as if it was defined sing guilke's module system ... never tried to use a r7rs module yet
<daviid>there might be some experts wrt this here ...
<apteryx>I think so; in r5rs-like you'd import the r7rs things using #:use-module (srfi srfi-128) instead of (import (scheme comparator))
<apteryx>r7rs seems a top-level organization of srfi modules exports
<daviid>ok great, glad it's a none issue then
<apteryx>I'm not sure, but so far that's what I assume from what I've read :-)
<chrislck>sneek: botsnack
<sneek>:)
<apteryx>where is case-lambda defined?
<apteryx>nevermind, it's builtin
<apteryx>is it possible to use cond-expand for #:use-module during module definition?
<apteryx>to emulate this style: https://github.com/scheme-requests-for-implementation/srfi-209/blob/master/srfi/209.sld#L9
<apteryx>there was an effort to port srfi-125 to guile 4 years ago, it got reviewed, but never moved on from there? https://lists.gnu.org/archive/html/guile-devel/2019-01/msg00016.html
<apteryx>not sure if I should use that one or the upstream directly at https://github.com/scheme-requests-for-implementation/srfi-125#by-john-cowan-and-will-clinger, like we do for srfi-64 for example
<apteryx>the code is still available at https://github.com/jessymilare/guile/commits?author=jessymilare
<apteryx>the reference implementation has bug fixes that were reported by that individual :-)
<apteryx>ACTION tries the reference first, as it's less code
<apteryx>not a texinfo, but at least the r7rs revision text is available here: https://small.r7rs.org/attachment/r7rs.pdf
<euouae>Hello
<euouae>I'm using geiser-guile on emacs and I'm having trouble understanding how to use the repl
<euouae>I'm new to guile and scheme so I may be doing something fundamentally wrong
<euouae>This is my file, <https://termbin.com/nqhr> and I am using geiser-mode-switch-to-repl-and-enter which runs ,m (hello) and then the prompt becomes scheme@(hello)>
<euouae>But then I can't e.g. call (hi)
<euouae>all symbols are unknown
<apteryx>the module expects a strict file hierarchy
<apteryx>do you have the parent directory of hello.scm in your %load-path ?
<apteryx>is there a way to import a symbol with #:select meaning also #:replace ?
<apteryx>to avoid: WARNING: (srfi srfi-126): imported module (rnrs hashtables) overrides core binding `symbol-hash'
<apteryx>ah, I guess it'd be the responsibility of (rnrs hashtables) to use #:replace (symbol-hash)
<euouae>apteryx: I do not have it in my load path
<euouae>apteryx: okay maybe modules are too much for me right now, how can I hack some guile in a file?
<euouae>What is the command to start the repl and evaluate some define's, etc?
<euouae>Ah, so I have to use C-c C-b to evaluate a buffer in a repl
<rekado>I’m using fibers and inside of (run-fibers …) I need to use popen.
<rekado>I’m writing to a temp file and then run a command with popen and read its output
<rekado>sometimes this fails with an error telling me that the file handle is closed.
<rekado>I’m guessing that this is related to suspendable ports.
<rekado>is there something I can do about this to avoid the error?
<lilyp>I mean, obviously running popen outside of run-fibers would work, but that defeats the point, no?
<rekado>it does
<lilyp>imho, even with suspendable ports that reeks like a bug
<rekado>I don’t really understand the behavior; I don’t see where exactly it fails.
<rekado>I’m using call-with-temporary-output-file from (guix utils)
<rekado>I haven’t yet figured out whether it’s the temporary file that gets closed or the pipe that I open with open-pipe*.
<rekado>perhaps disabling suspended ports in the run-fibers call would bypass this? From what I understand it would merely block execution of other fibers when one fiber blocks.
<lilyp>hmm, speaking of which, you might want to check whether guile-fibers triggers the right fiber on I/O activity
<lilyp>it could happen that the current-read/write-waiters are doing something they shouldn't
<rekado>oh, how do I do that?
<lilyp>uhhhhhhhh… peek?
<lilyp>(I have no idea, in case you're wondering)
<rekado>:)
<mirai>is there a way to profile what's making guilec take so long for a specific file?
<lilyp>hmm, you could try running guilec without optimizations first; then do delta debugging
<lilyp>(assuming optimizations are the cause)
<lilyp>if it's taking ages even with optimizations, you might want to debug your syntax helpers
<apteryx>what is the fixnum range in Guile?
<apteryx>greatest-fixnum
<apteryx>depends on the architecture
<apteryx>is there a module #:replace equivalent for the r6rs libraries?
<apteryx>I'm finding that (rnrs hashtables) exports symbol-hash without the replace hint
<apteryx>causing warnings
<lloda>since these are the same binding i'd use re-export in a guile module form not replace
<lloda>but idk how that is done with the r6rs form
<lloda>looks like a bug!
<apteryx>apparently nothing in standard library to do a replace, so it's up to the user to rename the conflicting bindings
<apteryx>(I asked in #scheme)
<apteryx>lloda: do you mean the symbol-hash exported by (rnrs hashtables) is that of guile itself? (not overridden?)
<lloda>yeah that's what it looks like
<apteryx>looks like that indeed
<lloda>the warning is unnecessary when it's the same binding, so guile could check that and not warn idk
<lloda>that wouldn't solve the general problem
<apteryx>or maybe just don't export that symbol when using guile :-)
<apteryx>since it's always going to be there... if it's not overridden there's no point messing with it
<apteryx>ACTION tries
<apteryx>works
<apteryx>I'll send the fix along the (srfi srfi-126) addition shortly
<apteryx>is someone interested to be added in CC ?
<apteryx>srfi-126 is a hash table library
<apteryx>why do we have a 'master' and a 'main' branches?
<apteryx>master is abandoned, right?
<apteryx>ACTION realize they were working on top of 2 year old master
<apteryx>I'd encourage anyone with commit rights to remove this stale branch, to avoid confusion :-)
<old>On the topic of hash table
<old>I wonder if there would be interest to have a performant hash-table for high read, low write, for example a cache
<old>Currently, hash table use mutex internally and I don't even think it is a read-write mutex
<old>There's probably a way of making very efficient hash-table for the read-side with serialization and synchronization on the write side like RCU can do
<apteryx>the patch adding srfi-126 to guile is at https://lists.gnu.org/archive/html/guile-devel/2023-11/msg00001.html
<apteryx>there's no (rename deprecated:hash hash) r6rs 'library' equivalent in define-module, right?
<apteryx>that is, export 'a' as 'b' ?
<apteryx>a being defined in self
<apteryx>I guess 'sed' will do.
<apteryx>^^'
<apteryx>is 'import' an alias to use-modules in Guile?
<rekado>I use ’import’ as an alias for use-modules
<apteryx>it is one at the REPL, which my explain my confusion
<apteryx>when we switch to r7rs in Guile it'll be 'import' :-)
<rekado>I’ve been using plain sxml in my web applications so far. I’d like to move away from embedding sxml in my code and move all views to separate files.
<rekado>in Python projects I’ve used Jinja2 templates and I’m looking for something similar to that, but more schemey
<rekado>I know that Skribe/Skribilo exists. Has anyone here used Skribe for HTML templating?
<haugh> https://lists.gnu.org/archive/html/guile-user/2015-07/txtsOA5H5Utnd.txt
<rekado>haugh: interesting, thank you
<haugh>rekado, yw! Please let us know how your project goes. Personally I'm only tangentially interested in the frontend but what little I've seen of it in Guile has been very unconventional and that's exciting
<rekado>I think I got closer to understanding my fibers problem