IRC channel logs
2023-06-14.log
back to list of logs
<Kolev>Has anybody replaced shell scripts with Guile? <dalepsmith>The regular old sh/bash seems to be a decent enough DSL for running commands. <RhodiumToad>the main thing is that sh is available, and guile might not be <Kolev>Most of what I do is shell scripting, so I'd like to start doing it in Guile to get my feet wet in Guile. <flatwhatson>well you have everything you need for pipes & filesystem access, guile is capable in that area <dthompson>and has a number of handy procedures for making it easier <dthompson>guile has good posix support so it's just a matter of writing the kinds of abstractions that make your life easier <old>I usually use a #!/bin/sh that exec guile on the script <old>and all my projects scripts are now written in Guile <old>that allow me to import command modules <old>ofc, basic one line bash script are still relevant .. <old>but anymore than that is better in Guile imo <flatwhatson>i also like working in the repl, you can have the same iterative process that you do in a terminal, but dealing with actual data structures <cow_2001>okay, i just call curl instead of (web client), and use guile-lib's praghtml to get an sxml. now i need to somehow figure out how to get stuff from it. <cow_2001>which one's better for the odd scraping? <RhodiumToad>depends, I guess? what does the sxml look like and what do you want to extract? <lloda>is it acceptable to truncate-print ((a b c) (x y z)) to "((a b…", that is without the parens, rather than bailing out with a "#" <lloda>tbc truncated-print already matches parens in most cases. This is just about the cases where it prints "#" <cow_2001>aaaaa! (sxml->html (html->sxml html)) is not.. uh.. identity! <cow_2001>(equal? html (sxml->html (html->sxml html))) failed here. something to do with melding "\n" "\t" into "\n\t" or vica versa <spk121>Today I learned that, on Win32, Guile's spawned process tests hang because processes don't exit when their pipes are closed. There is no MinGW SIGPIPE. That explains a lot <spk121>But there seems to be a lot of fake SIGPIPE in Gnulib. I just don't know why it isn't having the desired effect for Guile MinGW <rekado>I’m playing with Server Sent Events <rekado>my Guile web server responds to a GET request with a slowly produced stream of strings <rekado>even though I’m using a procedure to write the response to the port it seems that the client waits for the response body to be fully generated <dthompson>ACTION is in the guile-gnutls mines, stumbling over a bunch of C code <rekado>do I really need to replace the http server implementation, including http-write and run-server? <rekado>reimplementing this all takes much too long. What good is the feature to provide a procedure for generating the body when it’s all turned into a bytevector anyway? <dthompson>I haven't looked at the web server code in a long time... <dthompson>probably there are things that would have been done different had suspendable ports been a thing at the time? <Kolev>daviid - How do I install G-Golf now? Same as before? <daviid>Kolev, yes, pretty clean procedure, congrat for the notes - for the g-golf configure step, you dson't need GUILE=/usr/bin/guile, just ./configure --prefix=/usr ... <Kolev>configure: error: Package requirements (guile-lib-1.0 >= 0.2.5) were not met: <daviid>Kolev: i'll let you find why, we did all this already ... <RhodiumToad>remember that pkgconfig needs to find guile-lib's .pc file <RhodiumToad>either that file should be in whatever place pkgconfig looks, or you need to supply an environment variable to tell it where to look <Kolev>RhodiumToad, I did `sudo make uninstall` and `sudo make install`. 😞️ <Kolev>/usr/local/lib/pkgconfig/guile-lib-1.0.pc exists. <Kolev>I guess my notes were incomplete. <Kolev>I guess I can just use the other laptop for this, where it is alr. installed. <Kolev>I'll just use the other laptop. <Kolev>RhodiumToad, maybe I have it in backlog. What string should I search for? <Kolev>I searched for "Gash Guile" and got a funny image in DuckDuckGo. <daviid>Kolev: in your guile-lib steps, you forgot to pas the prefix <daviid>Kolev: re read the log of this channel, we've been there already .. <daviid>np! don't forget to update your notes ... <Kolev>daviid, yeah, I've updated it. <rekado>when streaming a response to the HTTP client, how can I prevent my pipe from being broken? <RhodiumToad>on some OSes there's a socket option to turn off sigpipe from a socket <civodul>rekado: (sigaction SIGPIPE SIG_IGN)? <rekado>I really don’t know what I’m doing. I’m no longer getting random Broken pipe errors after doing what guix publish does: duplicating the response port and configuring the client socket. <rekado>all it does is keep response bodies that are procedures untouched until http-write can evaluate them