IRC channel logs

2021-10-21.log

back to list of logs

<Zelphir>Like this: https://paste.debian.net/1216195/ I did not know that was how Guile handles it. That might come in handy at other times as well.
<Zelphir>Only that I would need to transform items in the alist in `(symbol-from-peg-parsing alist)` into that `#:name` form first.
<Zelphir>It might make for a super readable procedure definition though. All the arguments are keyword arguments and no searching necessary for attributes inside that procedure.
<Zelphir>And transforming that alist should work in linear time.
<lampilelo>or adapt the code of let-keywords to your syntax
<Zelphir>So I wrote this: https://paste.debian.net/1216199/ but it does not achieve the '(#:key1 val1 #:key2 val2 ...) form. Instead it seems to create symbols as follows: `(#{#:a}# (1) #{#:b}# (2) #{#:c}# (3))`. Should I use something other than string->symbol?
<Zelphir>I think #: is a syntax for creating keywords and I need to actually create a keyword and not a symbol.
<Zelphir>Found it: (symbol->keyword (string->symbol "a"))
<RhodiumToad>hm, why is there not a string->keyword, one wonders
<Zelphir>Hmmm :)
<robin>RhodiumToad, yeah, it's odd given that there are C string->keyword functions (there's string->keyword in srfi-88 but presumably that just composes symbol->keybord and string->symbol)
<RhodiumToad>yeah, it does
<tohoyn>sneek: botsnack
<sneek>:)
<lloda>There is no need to put manual newlines in SCM_DEFINE docstrings it seems
<lloda>some functions in Guile have them and some don't
<lloda>is there a way to set a parameter so that errors inside a scope report a different procedure for the error? without having to catch and rethrow everything, or do redundant checks
<lloda>guess not
<lloda>ok to merge? http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=6be51f9bbf47692ee5747b2cac6b372df65de970
<wingo>it's a lot of functions but is in the gnu module and has no C, so i am thinking it is fine; only qualm/question would be, would these bindings be in the default env or not
<lloda>you have to import (srfi srfi-4 gnu) so no (iiuc)
<wingo>sgtm then
<civodul>hey ho!
<lloda>hi
<civodul>wingo: not sure if you've seen but cwebber et al. are working on merging the elisp branch on "main"
<civodul>i haven't taken the time to look into it
<civodul>(and probably won't be able to do so seriously before some time)
<civodul>but i think it'd be great to have it merged
<civodul>as long as it's mergeable according to main's constraints (API, ABI, etc.)
<civodul>WDYT?
<lloda>merged the srfi-4 thing
<lloda>oops
<wingo>civodul: agreed wrt goals :)
<wingo>haven't looked into details
<lloda>i just tested wip-elisp-rebased against my programs and i didn't find any issues
<stis>Hello guilers!
<RhodiumToad>evening
<robin>"Actually separate out CPS into two languages: high-cps, and low-cps." -- cwebber. you'll take the low pass and i'll take the high pass, and i'll be in JS afore ye...
<jab29>robin...I actually thought of a cool guile optimization...
<robin>yeah?
<jab29>wingo mentioned that if we re-wrote the scheme standard today, then we make all values constant and immutable by default.
<jab29>If you also undefined set! and other like functions....
<RhodiumToad>...
<jab29>we all procedures could use values by reference (aka pointers) instead of pass by value (aka copying the values)
<jab29>I wonder how hard it would be to make a #lang super-fast-guile
<jab29>that would undefine set! and the like...make all variables immutable, etc. It would probably require some changes to the compiler...
<RhodiumToad>what would you do about objects, records, etc?
<jab29>RhodiumToad Do those objects need to be mutable?
<jab29>I'm not a language designer... :)
<RhodiumToad>well in one sense nothing "needs to" be mutable, but on the other hand, if you only have immutable objects, some operations become very expensive
<RhodiumToad>consider vectors for example
<jab29>RhodiumToad Ok. Fair enough. I was about to ask you for an example. :)
<RhodiumToad>if vectors are immutable, then you end up having to make a modified copy of the whole vector instead
<jab29>vectors are like arrays, yes?
<RhodiumToad>yes
<RhodiumToad>vectors are 1-d arrays
<RhodiumToad>(also guile has many other array types)
<jab29>RhodiumToad I can see that you would want arrays to be mutable. That's what makes them so useful.
<RhodiumToad>then there's the fact that guile exists to be an extension language for other apps, which means it's interacting with an environment full of mutable state
<RhodiumToad>I myself actually prefer a more functional style, and when I started getting into scheme I found it odd that set! and friends were as widely used as they are
<jab29>RhodiumToad Are you saying that if we made and used #lang super-fast-guile to extend a C application, that it wouldn't really be all that useful...because we could not mutate the environment? I guess that makes sense.
<jab29>RhodiumToad I
<jab29>RhodiumToad I've been playing a little in the guix codebase. I rarely see !set and friends used. Is that fairly rare for a scheme program?
<RhodiumToad>I don't know, I wouldn't consider myself that much of an expert
<jab29>ok. Just curious.
<jab29>RhodiumToad Would you like to see a #lang typed-guile like what racket has?
<RhodiumToad>haven't looked at what racket has
<jab29>I think it would be kind of nice. I'm working on an opensmtpd service for guix...I'm sanitizing all of the fieldnames for each record. It feel like I'm overdoing it, but I feel like it'll help someone who accidentally puts in a number instead of a string for a configuration bit....
<jab29> https://docs.racket-lang.org/ts-guide/
<RhodiumToad>hashtables are another very good example of mutable state