IRC channel logs

2022-06-10.log

back to list of logs

<daviid>tohoyn: (and any other g-golf users), g-golf callback (GICallbackInfo) support pushed! to the devel branch, let me know, when you have some free time, how this goes on your side ...
<daviid>here is a (somehow 'stupid', but usefull as a proof of concept/testing) example - https://paste.centos.org/view/1032357b
<lilyp>apteryx: browsers are smart, yes
<ArneBab>apteryx: if you want to build something like that, you can take what you need from my upload-server: https://hg.sr.ht/~arnebab/wispserve/browse/wispserve/serve.w?rev=tip — that does a lot more (it’s a start towards having a distributed downloader aka download mesh, and it supports some streaming), but it should provide what you need.
<ArneBab>apteryx: you need an actual server for a lot of Javascripty-stuff.
<apteryx>ArneBab: thanks for the link!
<ArneBab>glad to help :-)
***ec_ is now known as ec
<stis>Hi guilers!
<GNUtoo>hi, I'm new to scheme, and I was wondering if it was easy to parse a scheme file with guile?
<GNUtoo>Basically I've some scheme code in a file and inside that code there is a variable that I'd like to extract
<GNUtoo>The issue is that I just want to get the variable content without having to compile / eval all the file, is that possible?
<unmatched-paren>GNUtoo: as in you want to access an AST or something? scheme's simple syntax means you can just (read "FILE")
<unmatched-paren>which gives you the file as scheme data
<unmatched-paren>"code is data", after all!
<GNUtoo>oh nice
<GNUtoo>I'll try
<unmatched-paren>so a file containing (display (string-append "foo" "bar")) would read as (list 'display (list 'string-append "foo" "bar"))
<unmatched-paren>or '(display (string-append "foo" "bar"))
<unmatched-paren>quote and unquote will probably be expanded into (quote ...) and (unquote ...)
<GNUtoo>Is (display (read port)) supposed to display me the full file content?
<unmatched-paren>GNUtoo: it'll display the first form
<unmatched-paren>subsequent reads will display the next form
<GNUtoo>ohh ok
<GNUtoo>nice thanks a lot
<unmatched-paren>and then it'll return #<eof> when there's no more forms
<unmatched-paren>so you could loop over them with something akin to `while read(port) != #<eof> { ... }`
<unmatched-paren>or collect them into a list
<GNUtoo>thanks I'll try to do that
<GNUtoo>Here I just need to evaluate a symbol in a file that has modules that aren't installed, so I'll try to make a recursive function to find that symbol and then I'll just eval it
<GNUtoo>Hi again, is there some way to make guile not output such messages: ";;; note: source file [...] newer than compiled [...]" ?
<GNUtoo>I've written a scheme program that prints some CFLAGS, and I'd like to use it inside the autotools (./configure --enable-strict-cflags)
<GNUtoo>However stderr seems to be printed somehow when trying to do that
<unmatched-paren>GNUtoo: that message just means your compiled guile object files are out of date, recompiling them will make that error go away
<GNUtoo>Indeed there is a cache and so on, but I wondered if there was another way to make it go away
***karlosz_ is now known as karlosz
*GNUtoo guesses that some people need to write tools that use stdout and stderr and don't want that message so I guess that there is some way to do it
<unmatched-paren>sorry, not sure
<unmatched-paren>but generally i thought stderr shouldn't really be parsed or manipulated in any way except to redirect it to log files?
<GNUtoo>dialog for instance does that where the stderr output is parsed by scripts and stdout is the dialog
<unmatched-paren>or to pipe it to something to search through it or whatever i guess
<GNUtoo>I'll try to workaround but the issue is that I don't know how to write portable shell scripts
<unmatched-paren>often i encounter tools where the stdout can be programmatically manipulated, but the stderr is basically a log
*unmatched-paren wishes unix had `stdlog` for that...
<GNUtoo>That exists too
<GNUtoo>There is a syslog interface
<unmatched-paren>alas, we cannot turn back to the 1070s
<unmatched-paren>s/1070s/1970s/, unix isn't THAT old :P
<unmatched-paren>GNUtoo: i know, but i'm thinking more of a fourth standard stream that can be directly viewed. that way stderr would be freed up for actual errors.
<GNUtoo>Hmmm that would probably complicate more things as it might work well for some use cases but less well for others
<unmatched-paren>for some reason loads of applications abuse it for non-error log messages.
<unmatched-paren>anyway, it would break backwards compatibility far too much, so let's just pretend i never said that :)
<GNUtoo>So maybe some special tool could do that instead (like get streams from fd or something like that) though here it wound't help much as the goal is to be as simple and portable as possible
<civodul>GNUtoo: GUILE_AUTO_COMPILE=0 should allow you to get rid of those messages
<lilyp>well, in a sense stderr was meant not purely for errors
<GNUtoo>In my case (guile 2.2 I think) GUILE_AUTO_COMPILE=0 still prints the messages
<GNUtoo>guile (GNU Guile) 2.2.7
<civodul>well, GUILE_AUTO_COMPILE=0 could have prevented auto-compilation that in turn triggered those messages, maybe
<civodul>depends
<civodul>but that doesn't directly affect messages
<civodul>hmm
<GNUtoo>--no-auto-compile does the same (still the messages)
<civodul>you can parameterize current-warning-port in your code
<civodul>to send it to the bit bucket
<GNUtoo>ah that could work
<civodul>so (parameterize ((current-warning-port (%make-void-port "w0"))) ...)
<GNUtoo>Unfortunately it doesn't work
<GNUtoo>I still got the compiler messages
<GNUtoo>Though if I change current-warning-port to current-output-port my prints are gone
<GNUtoo>(but not Guile's prints)
<civodul>you sure?
<civodul>presumably your code is not writing to current-warning-port, is it?
<civodul>(guix ui) does the above
<GNUtoo>It's not
<GNUtoo>My issues are just the messages that the interpreter itself prints to stderr
<GNUtoo>I was wondering if there was a way to disable them but I found none
<GNUtoo>Thanks anyway for the information, at least I learned about redirecting stdout/stderr inside scheme code ((parameterize ((current-warning-port (%make-void-port "w0"))) ...))
<daviid>GNUtoo: fwiw, i've successfully used --no-auto-compile with guile-2.2, worth investigating why it doesn't work inyour case, my1c
<daviid>to be used 'only' on app launching scrit imo, all other modules should be precompiled ...
<daviid>*scripts
<daviid>here is an example - http://git.savannah.gnu.org/cgit/foliot.git/tree/foliot/foliot.in
*GNUtoo will pastebin the details
<GNUtoo> https://paste.gnutoo.cyberdimension.org/guile/stderr/guile.log
<GNUtoo> https://paste.gnutoo.cyberdimension.org/guile/stderr/
<daviid>GNUtoo: can you add --no-auto-compile to your cflags.scm script
<daviid>and see
<daviid>exec guile --no-auto-compile -s "$0" "$@", not exec guile -s "$0" "$@"
<daviid>then chmod a+x cflags, then ./cflags
<ArneBab>but then it will be much slower, right?
<daviid>ArneBab: only the script
<daviid>all other modules,as i said above, should be precompiled/installed
<daviid>just like foliot doers
<daviid>as an example of course
<daviid>anyway, ijuat wanted to 'debug' the --no-auto-compile not being honoured, which doesn't make sense
<daviid>GNUtoo: please try and let us know