IRC channel logs


back to list of logs

<rilez>is there a standard way to expose delimited continuations in other languages that run on the guile vm?
<sneek>Welcome back rilez, you have 1 message!
<sneek>rilez, mwette says: I use texinfo comments above defines, see To generate the docstring I use my draft scheme-texidoc mode for emacs.
<tinga>Hi. (use-modules (ice-9 debugging trace)) is giving us "no code for module (ice-9 debugging trace)", what's up?
<rilez>i think there's a way to get the search path/locate the file containing a module
<rilez>I think it's page 413 of the printed manual, section 6.18.7
<rilez>i'll check where the info about finding modules is too
<rilez>i recently had an issue where some of the standard libraries didn't install completely, and re-installing fixed it for some reason
***jonsger1 is now known as jonsger
<tinga>Thanks, will check later
<dsmith>tinga: There is a (system vm trace)
<dsmith>tinga: Those old debugging interfaces went away with guile 2.0 See the NEWS file.
***catonano_ is now known as catonano
<wklew>do streams have to occur in tail position to work properly?
<sneek>wklew, you have 1 message!
<sneek>wklew, manumanumanu says: you can use srfi-171 as well, which is also useful for stream processing, but with eager semantics. It does a kind of stream fusion of map/filter etc. For a (list-transduce (tmap 1+) rcons (list 1 2 3 4 5)) it is slightly slower than regular map, but already at (compose (tfilter odd?) (tmap 1+)) it is faster, at least in guile3.
<wklew>sneek, later tell manumanumanu: cool, that's interesting too!
<wklew>mixing streams and shift/reset is giving me trouble, and I thought non-tail calls might be the issue
<wklew>I'll paste some code tomorrow zzzz
***mauritslamers_ is now known as mauritslamers
<simendsjo>I recently completed a project in an ML-language which has been very successful much thanks to immutability. The API to update is pretty much a function `(Event -> State) -> State` (internally using a very small DSL for updating the state), and the state itself uses immutable lists, immutable dictionaries and immutable records. Are such datastructures and convenient syntaxes available for Guile or some other implementation?
<d4ryus>simendsjo: Guile has some immutable data structures: VLists, VHashes and immutable records come to mind.
<bonz060>simendsjo: perhaps vlists?
<bonz060>simendsjo: Also iirc, guix uses a bunch of immutable data structures, and they have some store monad to deal with side fx
<simendsjo>Thanks. So immutable records are `define-immutable-record-type`? Does it support a syntax for updating them? Something like `(with ((some-field 1)) some-immutable-structure)` for returning a copy of some-immutable-structure with some-field set as 1 in the new copy?
<simendsjo>bonz060: Do you know which on the top your head? I see `set` implemented on top of `vhash`.
<rgherdt>simendsjo: sure, take a look at set-field/set-fields in the srfi-9 info page
<simendsjo>rgherdt: Thanks, that's exactly what I was looking for.
<mwette>Guile also has intsets in (language cps intset). intsets are immutable integer-keyed hashes that use transients, a concept from racket.
<dsmith-work>Hey Hi Howdy, Guilers
<civodul>hey ho!
***jonsger1 is now known as jonsger
<wklew>Ok I've clarified my problem. If I have a stream which contains an unevaluated `shift` in its stream-car, is there a way to wrap it in a `reset` while forcing it?
<wklew>(reset (stream-car strm)) doesn't work afaik because by the time it gets to `reset` it's been forced
<wklew>the alternative is to store a thunk in the stream, so the thunk is returned by `stream-car`, but that seems... excessive?
<wklew>what I would really like to do is stream-map over a stream whose expressions may contain a call to shift, enclosing each in a reset prompt as it is forced
<RhodiumToad>so wouldn't it make sense to put the reset around a call to a procedure that does the stream-car call?
<RhodiumToad>hm, no
<RhodiumToad>maybe I'm missing why it wouldn't work as-is?
<RhodiumToad>reset is syntax, not a procedure, so it should establish the prompt before calling stream-car
<dsmith-work>Hmm. This is odd. Using buildroot to cross-compile guile for aarch64, the host-guile compile fails at guile-procedures.texi. But just a normal pull from master (apart from buildroot) works fine.
<dsmith-work>This was working about guile 3.0.2 IIRC. Curious.
<dsmith-work>Maybe there is still some funny with bootstrap .go files?
<dsmith-work>Hmm. A (full) make clean might have fixed it.
<dsmith-work>Looking good so far
<dsmith-work># uname -a
<dsmith-work>Linux maaxboard 4.14.78 #1 SMP PREEMPT Tue Jun 30 16:32:30 EDT 2020 aarch64 GNU/Linux
<dsmith-work># guile
<dsmith-work>GNU Guile 3.0.4
<R1ck77>Hi! what am I supposed to do with strings returned by scm_to_utf8_stringn after use?
<R1ck77>(free, scm_something_free, don't touch them, something else...)
<R1ck77>I admit i'm a bit surprised, I thought this was a Guile 101 question... is people using Guile to do C libraries interfaces around here? Just curious...
<R1ck77>(the alternative being that it's used as a plain Scheme implementation, nothing bad about it!)
<R1ck77>ok. It probably is a 101 Guile question, I'm just alone :D
<R1ck77>Thank you anyway! :)
<wklew>(define s (stream (shift k (k (k 0)))))
<wklew>(reset (1+ (stream-car s)))
<wklew>=> 1
<wklew>I'm expecting 2
<wklew>the shift is apparently evaluated before the prompt is in place