IRC channel logs

2023-10-05.log

back to list of logs

<singpolyma>lilyp: weird how?
<rlb>haugh: (lokke base syntax) is just one of the lower level modules in the whole dep tree, i.e. it implements clj things like when, let, cond->, etc. The docs should more or less just be clojure's for the things that match. And some of them like that as-> might transfer cleanly to scheme, others, not so much -- would require various degrees of pruning/adjustment.
<rlb>(where various clj compilation/semantics-related hacks leak through, etc.)
<haugh>rlb, okay, thank you for the follow-up. Lokke is, in my cursory estimation, a tremendous project that is unfortunately out of scope for me at the moment. It's hard to look at syntax which bridges that gap and estimate which parts represent good investments under a different paradigm. I'm trying to make Guile ergonomic without fighting its paradigms.
<haugh>It seems very important to me that the means of structured data access in Scheme is function composition. When I first started, I tried to use its extreme flexibility to copy paradigms I was familiar with; in the process I discovered new forms of repetition. Now I'm trying to find terseness without sacrificing flexibility. I'm kinda stuck. More immediately I'm running out of cash.
<mirai>How can I get more information to find out what's going wrong with a macro? (am getting unknown location: unexpected syntax in form ())
<jpoiret>mirai: you often can't and that's annoying. I try to always put a catch-all case in my syntax-case that raises an actual error with a location and a description to avoid this, but it's something the implementor has to do themselves
<mirai>ah, I've found out why
<mirai>my experiment at using (library …) instead of (define-module …) reveals that I need to put (guile) in the (imports …)
<civodul>mirai: (library …) is R6RS, if i’m not mistaken
<civodul>it’s not purely cosmetic
<RhodiumToad>presumably if you're writing to r6rs standards, you'd import (rnrs base) etc.
<mirai>thanks
<mirai>civodul: is there a list of “differences” between library and define-module?
<mirai>My impression was that they'd be equivalent <https://www.gnu.org/software/guile/manual/html_node/R6RS-Libraries.html>
<civodul>i think the default set of bindings is different
<singpolyma>And the moment you import guile you lose the portability advantage anyway
<RhodiumToad>looking at the code, define-module* calls beautify-user-module which imports the-scm-module
<RhodiumToad>(which is the (guile) module)
<RhodiumToad>whereas (library ...) does not
<RhodiumToad>hm. when using the meta switch on a #! line, there's no way to put local variables for emacs at the top of the file?
<RhodiumToad>since line 2 has to have the command-line switches
<graywolf>Hi, I want to write a web application in guile. It will run behind nginx, so it can be cgi, fastcgi, http, .... Could anyone recommend reasonably simple project(s) with good practices I could use as an inspiration? Any other tips are appreciated as well.
<apteryx>hello! there's still series on guile-devel that's been reviewed by Maxime already: "[PATCH v3 4/4] load: Display modules depth in output when using %load-verbosely."; the last commit is more involved but the first three are tiny.
<lilyp>graywolf: I'd recommend looking at guix-artwork for inspiration, it has a bunch of web pages written in guile (guix issues being one of them)
<graywolf>lilyp: Isn't that pretty much static website? I see haunt, iirc that is for compiling a static websites right?
<lilyp>yeah, haunt serves static web pages
<lilyp>not sure what you mean by web applications, but guile can in principle handle dynamic content – the manual even has an example for that
<graywolf>I basically mean a simple interactive website, that would be able to dynamicly generate pages, handle forms, ... I know there is a module (web server) or something distributed with guile, but that seems to be able to handle just a single request at once, so I am mainly curious if people have interactive websites in scheme and on what stack. Do people just spawn many threads? So clever use of
<graywolf>fibers? Was hoping for project to use as an inspiration how to approach this type of project.
<graywolf>Some clever*
<rekado>graywolf: I use the fiberized web server for that
<rekado>whenever I don’t use fibers I spawn a bunch of separate processes on different ports and have a reverse proxy in front
<mirai>is it me or the doc at <https://www.gnu.org/software/guile/manual/html_node/The-Meta-Switch.html> got mangled due to some texi shenanigans?
<mirai>“the meta switch \” ?
<mirai>and the `!#' in the first snippet? (probably a mistake since its only introduced later in the text)
<RhodiumToad>what do you think is wrong?
<mirai>the backslashes?
<RhodiumToad>the meta switch _is_ a backslash
<mirai>oh, I was getting the impression that the backslashes were some syntax error and that something else should have been there
<RhodiumToad>no; where you see a \ in the page, it literally means a \
<mirai>I'll have to re-read this page more carefully then
<mirai>just to confirm, this isn't part of SRFI-22 right?
<RhodiumToad>nope, this is just guile
<RhodiumToad>it's a workaround for the fact that #! allows only one argument
<RhodiumToad>#! /path/to/foo -a -b -c runs /path/to/foo "-a -b -c" scriptfilename
<RhodiumToad>the meta switch is a hack that tells guile to read command-line options from the second line of the script and pretend they were given as argv[1..]
<mirai>hmmm… what about this case “#!/usr/bin/env guile switches-here-…”
<RhodiumToad>that doesn't work and never has
<lilyp>nope, it's /bin/sh\n exec guile
<mirai>Can I use a env shebang since I have no idea what's the full name for guile?
<RhodiumToad>at least on some platforms you can use #!/usr/bin/env -S guile switches... because "-S string" is split apart by env(1)
<ArneBab>I just created my first Spring application and realized how crazy streamlined the generation is for a wealth of infrastructure. That’s what we’re up against: https://start.spring.io/
<graywolf>rekado: Would you have a link to any public code I could check out?
<lilyp>Friendly reminder that streamlined sadly doesn't mean bootstrappable :(
<mwnaylor>Opnion question. Any good Guile tutorials? Long time (general) lisp user. emacs/elisp since 2011. Dabbling in Clojure since 2015/16. I understand general lisp concepts, just not familiar with the Guile libraries.
<mwette> https://www.scheme.com/tspl4/
<mwette>and https://www.gnu.org/software/guile/manual/
<rekado>graywolf: that would be infrastructure as code. I don’t have anything public, but it’s literally just nginx with a backend definition that proxies to a handful of Guile application server processes, each bound to their own port on localhost.
<mwette>I would go through tspl4 to come up to speed on scheme (e.g., named let, define, syntax-rules)
<mwnaylor>I have the Guile manual. It's a bit dry. Will look into tspl4.
<mwnaylor>I'm mostly ok w/ let and define. syntax-rules is something else. Not really looking forward to that; seems to add another layer on top of defmacro. I am weak when it comes to macros.
<mwette>named-let is crutial IMO: it's the basic looping construct in scheme (and I love it)
<haugh>How are you supposed to attach multiple irritants to an exception? The docs and the debug output seem to imply multiple araguments, but make-exception-with-irritants only accepts one argument, and exception-irritants only returns the first irritant from a compound exception with multiple &irritants exceptions
<haugh>Where is (@ (guile) error) defined? All I really want is a continuable version of that helper
<graywolf>rekado: I am pretty sure I can figure out the nginx, would not be the first time. I was curious about the fiber usage
<mwnaylor>Does The Scheme Programming Language address srfi? I know a little about it, but not how to search through it.
<haugh>srfi.schemers.org is afaik the best resource for SRFIs
<haugh>actually now that I think of it, I don't remember a single reference to a SRFI in that book
<mwnaylor>I have to admit I'm spoiled by the documentation that comes with Clojure. Some of the best I've seen.