IRC channel logs

2020-04-08.log

back to list of logs

<guix-vits>Hi Guile.
<Blackbeard>guix-vits: hi
<guix-vits>Blackbeard: i'm just pressed something, and got "HELLO" buffer in emacs; can't reproduce it. It shows charset support in emacs.
<Blackbeard>guix-vits: C-h ? Will give you all the help options
<Blackbeard>I don't remember right now which one is for hello
<Blackbeard>Maybe C-h h
<guix-vits>Blackbeard: yes, C-h h; thanks
<Blackbeard>Haha yes, gotta love Emacs
<guix-vits>Вітаю Guile
***rekado_ is now known as rekado
<manumanumanu>hungry-delete-mode
<manumanumanu>... sorry
<manumanumanu>too much input lag. VNC.
<lloda>anyone seen a problem using srfi-64 where you (set! test-log-to-file #f) and it still writes logs anywayf
<lloda>^H
<manumanumanu>lloda: is that expected to work? I thought you had to write your own test runner to not output anything
<manumanumanu>lloda: maybe try (set! (@@ (srfi srfi-64) test-log-to-file) #f). That won't work in guile3 i suspect, since the module is declarative
<manumanumanu>So, I want to host a real website using the guile webserver. How should I best do it? The guile server will be responsible for serving everything that ends in .gml (or whatever I'll call it), and the rest should be handled by a regular web server.
<manumanumanu>Do I want a reverse proxy?
<manumanumanu>I have avoided everything that targets the web since about 2002, so i feel quite lost.
<rekado>manumanumanu: I always use a reverse proxy
<rekado>I often use a pool of Guile web server processes and have the reverse proxy serve as a load balancer
<manumanumanu>great. That's what I thought.
<rekado>with nginx as the reverse proxy you can match on locations ending on .gml (or whatever) and pass only those to the application server(s)
<rekado>so other requests won’t be seen by the application
<manumanumanu>even better.
<manumanumanu>Then I only need to figure out if I can splice raw HTML into sxml templates for those ugly files which I haven't made a proper markup...
<manumanumanu>Why did I jump on to the markdown bandwagon instead of just continuing to use my old xml format? :D :D
<manumanumanu>guile-commonmark might work for that though :D
<lloda>thx manumanumanu I did try the @@ and it didn't work probably b/c of the declarativeness thing. It used to work before and maybe that's what broke it.
<lloda>I can put that flag in a box I guess
<manumanumanu>lloda: the upstream srfi-64 exports that binding, and even though it isn't part of the spec, it should really be counted as a regression that it stopped working
<manumanumanu>maybe the srfi-64 module should be non-declarative.
<manumanumanu>or that variable should be boxed, if we want to deviate from upstream.
<manumanumanu>you are more qualified to reason about that than I am, though, and in a much better situation to start a discussion about it.
<manumanumanu>if there are any speed improvements of the declarativity of srfi-64, you could hack the variable to be identifier-syntax and do boxing and unboxing.
<leoprikler>Hi, is there a way of running a hook until the first procedure succeeds without reinventing hooks themselves?
<leoprikler>I guess probably something from SRFI-1 could help me if I used hook->list, but I'm looking for a "simpler" solution.
<marmulak>is guile the best scheme to develop with, or are there other schemes you guys know about or use?
<srandon111>guys fromm the manual how can i understand how to convert a bytevector vector to an hex string?
<guix-vits>marmulak: idk, but emacs is aware of those: chez, chibi, chicken, gambit, guile, mit, racket
<leoprikler>Guile is the freeest ;)
<dsmith-work>Wednesday Greetings, Guilers
<RhodiumToad>hm, there's no vector-fold or similar for bytevectors?
*RhodiumToad curious about srandon111's question even though they left
<leoprikler>you probably want generic array procedures
<brendyyn>(guix bytevectors) has that, although it pads the bytevector to an even number of zeroes, and errors if you give it an unpadded one
<marmulak>I like how guile compiles my scripts before running them, although I kind of want to suppress the output of the compilation message. It's too verbose
<RhodiumToad>ah, array-for-each works, that's close enough
<leoprikler>you could also convert the bytevector to a list first and then fold
<leoprikler>or to a string and then string-fold if you're really evil ;)
<RhodiumToad>hm. array-map-in-order! and array-for-each only pass the element and not the index, while array-index-map only passes the indices and not the element
<brendyyn>I found myself needing to translate pythons [::-1], but it works on both strings and bytes, so i would convert to bytevector, use a bytevector-reverse i made, and then back to string.
<brendyyn>srandon111: there is bytevector->base16-string in (guix bytevectors), although it outputs hexadecimals with padded with zeros to an even length
<jcowan>RhodiumToad: SRFI 160 is pretty portable and provides folding over u8vectors; these are not the same as bytevectors in Guile (uniquely so AFAIK) but could be easily adapted to them
<dsmith-work>marmulak: Yes, that's often requested.
<marmulak>rightly so!
<RhodiumToad>(define (bytevector->hex bv) (call-with-output-string (lambda (port) (array-for-each (lambda (b) (put-string port (number->string (ash b -4) 16)) (put-string port (number->string (logand b 15) 16))) bv))))
<RhodiumToad>simpler but relies on format:
<RhodiumToad>(define (bytevector->hex bv) (call-with-output-string (lambda (port) (array-for-each (lambda (b) (format port "~2,'0x" b)) bv))))
<dsmith-work>format actually has some looping things built in ( ~{ and ~} ) , but they are for lists.
<jcowan>bring out your format combinators
<dsmith-work>format sure seems a lot like lisp format.
<dsmith-work>I wonder if printf was inspired by lisp format.
<jcowan>I would guess independent invention
***lfam_ is now known as lfam
***guix-vits is now known as guix-ci
***guix-ci is now known as Guest75614
<RhodiumToad>is it considered bad style to use letrec-syntax to define convenience abbreviations used by a small number of functions?
<jcowan>I personally avoid let-syntax in general and just use define-syntax at the top level, but inside a library if I don't want to expose it. But I wouldn't call it bad style specifically.
<jcowan>Note that there are issues around the interpretation of let-syntax
<jcowan>as to whether it expands to a lexical countour (let () ...) as in R7RS or not as in R6RS. R5RS was ambiguous.
<RhodiumToad>hm
<RhodiumToad>that was the second question
<jcowan>I voted for the contour interpretation in the R7RS-small committee, but that's because I misunderstood the issue.
<jcowan>It's easy to do a contour version given the splicing version, but not vice versa.
<manumanumanu>RhodiumToad: I have a bytevector to hexstring if you want it. it uses a lookup table, though.
<manumanumanu>RhodiumToad: https://bitbucket.org/bjoli/hex/src/default/hex.scm
<manumanumanu>It is decently fast, but not constant time.
<manumanumanu>I will move it to sourcehut and make it public domain.
<manumanumanu>Good night folks!
<apfel>hi there, can i somehow redefine a inner function of a function from outside the function? Like, i want to redefine inner-fun from this example on the repl: https://pastebin.com/2k7AJRk9
***dddddd_ is now known as dddddd
<mwette>apfel: can you use this: https://paste.debian.net/1139193/
<apfel>mwette: hm, thanks
<mwette>or you have to pass the "inner function" as an argument to outer-fun
<jcowan>manumanumanu: I'd like to reuse your hex library in SRFI 178, with a bit of renaming, are you OK with that?
<jcowan>The license would need to change to MIT, but that's pretty trivial
*davexunit made a new release of chickadee (game programming library) https://dthompson.us/chickadee-050-released.html
***jonsger1 is now known as jonsger
<rekado>oh, nice!