IRC channel logs

2023-10-10.log

back to list of logs

<rlb>rekado: fwiw, there are a bunch of options in the clj world (seems nearly an attractive nuisance), and I've wondered about variants of them for guile (or lokke). Most are based on "ring", which just presents web requests as a well-defined persistent map to a handler you provide (often the jetty adapter): https://github.com/ring-clojure/ring/wiki/Concepts The routing libs typicallybuild on that, and one of the earlier was compojure
<rlb> https://github.com/weavejester/compojure/wiki/Routes-In-Detail
<rlb>rekado: but that was macro driven, and some people wanted a more data-driven, declarative approach, which led to bidi, etc. (bidirectional routing function) https://github.com/juxt/bidi and lately I've gotten from some people the impression that retit might be what I'd try if I were starting from scratch: https://github.com/metosin/reitit
<rlb>And I think some of these may do fancy optimizations on the routes.
<rlb>Not sure if that's useful, possibly as prcedents, but I've been wondering myself some wrt guile. web serving is one of clj/jvm's happiest paths, I'd estimate.
<rlb>I know people who do some fairly fancy things with the bidirectional data-driven routes (they were using reitit I think it was), i.e. automatically traversing the routes to inject/augment, etc.
<mwnaylor>Taking advice I got on this channel, working my way through The Scheme Programming Language, 4th ed. Some concepts are review, as they pertain to Lisp in general. Some are Scheme specific, like the differences between `define' and `defun' for creating functions. Will tag channel when/if I have guile specific questions.
<graywolf>Hello :) How can I get a source location for a variable? I tried source-properties, but I am getting empty list. Is there some trick to it? Does guile even store this information?
<lilyp>graywolf: the answer to that is an "ehh, maybe".
<lilyp>if you need it, it's better to write your own syntax transformer
<graywolf>Hm, that sounds too advanced, so I will cheat a bit. However thanks for the tip, that topic will go onto my reading pile :)
<dthompson>some news about guile hoot (scheme->wasm compiler) https://spritely.institute/news/scheme-wireworld-in-browser.html
<graywolf>Hm, this is maybe a dumb question, but how do I do http-request with accept:application/json? I am getting Bad request: Bad value for header accept: "application/json"...
<graywolf>self-answer: #:headers '((accept . ((application/json))))
<rekado>rlb: thank you for the pointers
<graywolf>Hm, json body it not decoded into a string.
<graywolf>Lol I just spent last 30 minutes figuring out why json-read wraps the object on one more (). Well, (let*-values (data (json-read port))) and (let*-values ((data) (json-read port))) do different things. Good to know.
<RhodiumToad>the fact that let-values needs so many parens is one of its big drawbacks
<RhodiumToad>but receive and srfi-71 have their own issues too, so...
<graywolf>I need to check -71. Issues with receive are?
<RhodiumToad>receive only does one set of bindings
<RhodiumToad>srfi-71 replaces the builtin (let)
<graywolf>Oh, right, yeah, I know that.
<graywolf>Hm, not sure I like that
<graywolf>Will read the srfi
<RhodiumToad>but at least (let ((foo (func))) in srfi-71 works properly
<RhodiumToad>you just use (let ((foo bar baz (func))) to do multiple values
<graywolf>Hm but that does sound pretty reasonable
<graywolf>I was actually surprised let-values does not work like that
<RhodiumToad>(for some reason guile's srfi-71 fails to export uncons-2, uncons=3 etc.)
<ekaitz>hi, for http-client, any idea about why can the error `SERVICE not supported for `ai_socktype'.` appear in one machine and not in other?
<graywolf>I don't think I will need those for now, but the definition seems straightforward so I could just bundle them
<cwebber>Scheme in the browser....!!!! SCHEME IN THE BROWSER!!!!! https://spritely.institute/news/scheme-wireworld-in-browser.html
<old>cwebber: does this mean I can finally enjoy web development? :-D
<mwette>thanks for that news; exciting to read
<cwebber>old: yup! :)
<cwebber>mwette: yes! though it was dthompson who wrote it!
<cwebber>and dthompson and robin_ and wingo who are making Hoot happen :)
<dthompson>:)