IRC channel logs

2025-07-18.log

back to list of logs

<lechner>dsmith / thanks, i read that but can I save a conditional by assigning an architecture specific procedure to symbols at compile time?
<sneek>Welcome back lechner, you have 2 messages!
<sneek>lechner, dsmith says: Pretty sure eval-when only knows the symbols eval, load, compile, expand
<sneek>lechner, dsmith says: See https://www.gnu.org/software/guile/manual/html_node/Eval-When.html#index-eval_002dwhen Best not to experiment if you have a cat
<identity>lechner: i guess you could use cond-expand, but you probably should not
<dsmith>lechner, I really don't think so. The code is around line 1071 in module/ice-9/psyntax.scm Best not mess with psyntax.scm
<identity>architecture-specific stuff should not be in your code, unless your code is an compiler, IMNSHO
<lechner>dsmith / okay thanks. i have been reading psyntax (or been trying to). Sometimes, Guile won't build when I bootstrap it differently. What are the capabilities of Guile before it is fully bootstrapped, please? Which features are added late?
<Kolev>I installed Guile with Guix. How do I get a nice Guile prompt?
<lechner>in the REPL?
<lechner>identity / my code is a compiler, of sorts
<Kolev>lechner, REPL.
<dsmith>lechner, Sorry, that's beyond my meager understanding..
<lechner>Kolev / https://stackoverflow.com/a/54960589
<lechner>dsmith / thanks!
<Kolev>lechner, all that does is >>> the prompt.
<lechner>Kolev / Sorry, I'm not sure. You want the lambda?
<Kolev>lechner, I want a nice colored prompt and stuff.
<Kolev>Here we go: https://dustycloud.org/misc/guile-tutorial.html
<Kolev>Hm. I installed guile-readline but it won't load.
<Kolev>lechner, figured it out! (use-modules (ice-9 colorized)) (activate-colorized)
<sneek>Yey! janneke is back!!
<lechner>Kolev / yeah, sorry. i actually had that in my .guile
<Kolev>Is there a way to get syntax highlighting too?
<lechner>Kolev / I'm not sure but the REPL has a lot of warts. You may be better off with Geiser, if you are using Emacs anyway
<lechner>meaning, readline isn't that great
<dsmith>And once in emacs, you can then use paredit. Amazing.
<dsmith>I delayed getting into it far too long..
<Kolev>I never got the hang of paredit.
<rlb>dsmith: me too -- should have made it sink in much sooner than I did :)
<rlb>...clojure-mode has some additional fanciness that might be interesting if threading forms become standard enough, i.e. it can automagically thread/unthread a nested set of forms for (in clj) -> and ->>, etc. (for those who don't mind threading forms).
<rlb>I hadn't even thought of that yet wrt srfi-197.
<dsmith>sneek, botsnack
<sneek>:)
<dsmith>!uptime
<sneek>I've been serving for 6 months
<sneek>This system has been up 25 weeks, 5 days, 10 hours, 34 minutes
<sibl>is it expected that `(read-enable 'hungry-eol-escapes)` doesnt change the behavior ? When I use the flag --r6rs then it works without changing the code
<sibl>(display "This\
<sibl> Is another\
<sibl> multiline str\n")
<sibl>(read-enable 'hungry-eol-escapes)
<sibl>(display "This\
<sibl> Is another\
<sibl> multiline str\n")
<sibl>this is the code basically, and without --r6rs, it doesnt work
<sibl>and when I check with `(read-options 'help)`, the option is enabled after the `read-enable` but still doesnt change the behavior
<cow_2001>other than (unless (and (real? x) (inexact? x)) (error "...")), how do you flag a procedure to be only on floats? https://dthompson.us/posts/optimizing-guile-scheme.html
<identity>cow_2001: that is pretty much the only way
<cow_2001>is it aware that records are made to be only floats?
<identity>i guess not, you should destructure your record and do the (and (real? x) (inexact? x)) thing
<cow_2001>ohm
<graywolf>Hello everynyan :) I have two questions.
<sneek>Welcome back graywolf, you have 1 message!
<sneek>graywolf, ArneBab says: thank you! I switched back to to #!/usr/bin/env bash, because that’s portable over to almost every system (/bin/sh could be dash) and added quoting for d=, but otherwise I switched to your version.
<graywolf>1. Will '() in a source code always result in a unique object? Or is the compiler allowed to merge the constants?
<graywolf>2. How can I get a file name from which a module was loaded? module-filename seems to give just a relative name, which has some limitations...
<identity>graywolf: '() aka the empty list is always the same object, quoted lists like '(1 2 3) are allowed to be merged, if you need a fresh list use (list 1 2 3) instead
<graywolf>ArneBab: Well the script is simple enough (pure POSIX) that dash (or even BusyBox's Ash) will suffice to execute it correctly. And dash is faster than bash. And, most importantly, /bin/sh saves one path lookup and exec over /usr/bin/env bash.
<graywolf>identity: Ok, so if I want to make a "guardian" object, where eq? identity matters, (define foo (list)) is the way instread of (define foo '()) ?
<identity>(list) is the same as '() as far as i know
<graywolf>Now I am confused. From what you said I understood that (define f '()) (define g '()) (eq? f g) is #f, but (define f (list)) (define g (list)) (eq? f g) is #f
<graywolf>is #t for the first one
<graywolf>Did I misunderstood?
<dthompson>(eq? '() '()) and (eq? (list) (list)) are both #t
<lloda>there's only one '() same as #f or #t
<dthompson>yeah, they're immediate constants
<graywolf>Oooh....
<graywolf>(eq? (list) (list)) -> #t ; (eq? (list 'a) (list 'a)) -> #f
<dthompson>right
<graywolf>Well... that is certainly good to know.
<graywolf>I am surprised this did not bite me earlier.
<ArneBab>graywolf: did you check whether your variable adjustments work on other shells? Whenever I see ${a:-b} and such, I explicitly require bash, because I don’t know whether it works elsewhere.
<ArneBab>graywolf: that sad: if it does work, I’ll happily switch to that. Saves 1-2 ms (and those can add up).
<graywolf>ArneBab: Well it should work on any POSIX compliant shell: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 ; I know bash have some extra ones, but I never learnt those :D
<graywolf>^F for "Remove Smallest Suffix Pattern"
<cow_2001> https://codeberg.org/Halfwake/guile-quad-tree/issues/9
<lechner>Hi, what's the timing for upcoming releases, please?
<dthompson>no specific time, as far as I know
<lechner>okay, thanks. is one coming at some point?
<lechner>what do I have to do to get a tiny patch in?
<lechner>i'd like to save the original argv, please, so I can do some things with the ELF auxiliary vector. the value is otherwise lost in Guile's initialization https://bpa.st/VC2A
<rlb>fwiw, I'm hoping to add some flavor of bytevector argv, e.g. (program-arguments 'bytes) or some other way to do the same, though that's potentially more complex than for say getcwd, because we also support mutation via set-program-arguments, meaning you could set the arg bytevectors to something incompatible with the current locale, which has to be accounted for somehow.
<rlb>I suppose in the short term, you could just (re)do exactly what we currently do on startup and so you'd just lose those "characters"...
<lechner>rlb / Hi, sounds interesting, but how do the argv's "characters" relate to the ELF auxiliary vector on the other side of the execution environment? It's binary data
<rlb>For my purposes, program-arguments returns a list of locale-converted strings, so you only have characters, and may have lost data but current default, during the conversion, relative to the original system argv.
<rlb>"by current default"
<rlb>i.e. corruption
<rlb>You can see this if you're in a utf-8 locale like this: guile -- $'foo\xb5bar'
<rlb>Then check (program-arguments)