IRC channel logs

2022-11-09.log

back to list of logs

<dsmith>sneek: seen sneek?
<sneek>Nope.
<sneek>ACTION giggles
<nckx>-ENOMIRROR
<nckx>Or: sneek is a vampire. I know which one I'll write fanfic for.
<dsmith>"sneek", "seen" metaphone to "sn"
<dsmith>Ok. The bot is happy now. I can think about tuning up my resume.
<nckx>AI?? experience: yes.
<dsmith>sneek has a lot of Guile
<dsmith>Nah. Just hate working on it so finding other stuff to do intead...
<cow_2001>okay. i've read up to but not including 3.4.2 Local Variables and Environments.
<old>cow_2001: Are you passing through the manual in an entire day? :-O
<cow_2001>no, now i'm just sleep deprived and should go to sleep.
<cow_2001>old: when will i learn not to stay up late? -.-
<cow_2001>okay, good night.
<old>Tell me when you're at section 6.11.5.2 :-)
<cow_2001>i am also learning C (going through K&R exercises) and some other stuff (bit of SQL)
<old>nice
<old>I can help with C if needed
<old>I'm much more of a guru on that side. Scheme is still new to me
<cow_2001>thank you
<cow_2001>new to you but you seem so capable O_O
<cow_2001>okay, good night :)
<old>gn
<old>and I'm very capable of doing good software engineering in scheme I think. But C I know waaaaay more thing
<dsmith>!metaphone sneek
<sneek>metaphone for sneek is sn%
<dsmith>sneek: botsnack
<sneek>:)
<dsmith>!metaphone sneek
<sneek>metaphone for sneek is sn
<dsmith>sneek: botsnack
<sneek>:)
<chrislck>!metaphone chrislck
<sneek>metaphone for chrislck is xrslkk
<chrislck>Ack!
<cow_2001>so (begin (a) (b) (c)) is just ((lambda () (a) (b) (c)))?
<cow_2001>no
<cow_2001>macroexpand shows some different things
<flatwhatson>they do basically the same thing
<cow_2001>and seq is new to me. i guess it tells guile which one to evaluate first?
<cow_2001>(macroexpand '(begin (a))) vs. (macroexpand '((lambda () (a))))
<flatwhatson>i'm not sure macroexpand is the best way to get an intuition for those
<flatwhatson>like yes there are differences but it's implementation details
<cow_2001>seq is unbound in the guile prompt hmmmmm
<cow_2001>flatwhatson: hmm
<flatwhatson>macroexpand is not showing you scheme, it's showing you tree-il, a different language
<flatwhatson>seq is not scheme, it's tree-il
<flatwhatson>the scheme equivalent of seq is... begin :)
<cow_2001>oooh
<cow_2001>oh boy
<flatwhatson>you can think of let and lambda and similar multi-expression forms as having an implicit begin around the body
<flatwhatson>begin is just the sequencing, let and lambda also do binding
<dsmith-work>Conceptually, it's lambdas all the way down. (Like let is just a lambda, and let* is just nested lets) But Guile special cases things while it's compiling.
<dsmith-work>Like it doesn't convert everying to a lambda first.
<cow_2001>oh my god i am starting to get the urge to surround command line commands with parentheses
<cow_2001>i will know my condition deteriorates when i start balancing text smileys
<dsmith-work>cow_2001: Just watch, soon you will be typeing (printf "yada yada" x y z) in C.
<dsmith-work>What's with this "C" thing anyway? Parens in the wrong place. All these extra "," everywhere. Ugh.
<cow_2001>okay, chapter 4 is more referencey. a list of possible arguments and similar stuff. not an engaging read like chapter 3.
<nckx>Heyo. Someone just noticed that FILE-EXISTS? works on numeric file descriptors, an undocumented feature. This is because it thinly wraps STAT, which does document that behaviour. But ice-9/boot-9.scm explicitly uses ???str???, so is this an undocumented feature that should be documented or an unintented bug?
<nckx>*d
<manumanumanu>how do I run the test suite after compiling guile?
<nckx>Oh, duh. It fails in the non-POSIX fallback mode (open-input-file ???) so it's just a bug. Would a patch to deprecate/warn about non-string arguments be accepted, or is this too set in stone?
<nckx>manumanumanu: Does ???make check??? not work?
<manumanumanu>not when you spell it wrong...
<dsmith-work>heh
<nckx>Damn computers.
<dsmith-work>Sooo picky!
<cow_2001>!metaphone poop
<sneek>metaphone for poop is pp
<cow_2001>!help metaphone
<dsmith-work>cow_2001: See https://github.com/igorhvr/bedlam/blob/master/sisc/sisc-contrib/irc/scheme/sarah/metaphone.scm
<dsmith-work>cow_2001: Tis what the bot uses to index things by nick
<cow_2001>oh boo. when you (use-modules ((a b)) #:prefix ::a::b::) you can (::a::b::c), but cannot (help ::a::b::c) and have to (help c) instead
<cow_2001>at the prompt
<cow_2001>mild inconvenience, right, but still an inconsistency
<ArneBab>cow_2001: or you???ll be using C with https://github.com/sph-mn/sph-sc :-)
<old>cow_2001: You can use the `describe` meta command instead
<old>(use-modules ((ice-9 ftw) #:prefix ice-9:))
<cow_2001>oh boy.
<old>,describe ice-9:file-system-fold
<cow_2001>thank you
<old>meta command are invoked with a comma `,` before
<old>you can list the help for meta commands with the meta-meta command `,help`
<cow_2001>too bad it only goes up to meta-meta and not meta-meta-meta, as `,help help` is just utilising the meta-meta `,help` command to look up itself :|
<old>Gotta stop the recursion at some point :p
<cow_2001>i am still confused about popen ~_~ need more examples
<cow_2001>i know how to use it fairly well in python
<old>Okay hold on I might have something somewhere
<cow_2001>i wish there were more examples in the manual
<cow_2001>or maybe a directory somewhere with many example scripts
<cow_2001>as part of the documentation
<old>Yes that would be nice. There's been talk of making a guile-cookbook by the community on the mailing list
<cow_2001>yes yes!
<old>Okay so typicalle after using module (ice-9 popen) you can use for example `open-input-pipe`
<old>That procedure will execute the command (shell) that you pass to it and return a port.
<old>That port you can read it since it's an input pipe
<cow_2001>what's the deal with ports? how do you interact with them?
<old>so something like `get-line` from (ice-9 textual-ports) should read a line from the inferior process
<old>They are the abstraction for I/O in Scheme
<daviid>fwiw there is a (ice-9 popen) example in the manual
<cow_2001>there is an example, but i need more examples <_<
<cow_2001>or maybe there is a certain concept i did not get yet
<old>When you're done reading the inferior port, you can close it with `close-pipe` not `close-port`. That will reap the child process and return its status
<cow_2001>hmm
<cow_2001>textual ports!
<cow_2001>okay, i should read about (ice-9 textual-ports)
<cow_2001>i guess that is the missing piece of the puzzle
<old>Well textual-ports is only really for reading/writing text on a port
<cow_2001>hmm
<old>port can be read/write in other way
<cow_2001>okay, 6.14 is where i should be, no?
<old>You can check the file `module/ice-9/textual-ports.scm` under the guile source tree. It's only 70 lines of code
<old>Eeh LALR(1) parsing is for making a parser for a given language
<old>Not something you want. Maybe the version you're looking is not the same that I have. For me 6.14 is about LALR(1) parser
<cow_2001>did i accidentally refer to lalr(1) parser API? i mean the Input and Output section
<cow_2001>it's 6.14 here
<cow_2001>on this version of the manual (which version is that? looking???)
<old>Oh okay, 6.12 for me.
<cow_2001>3.0.5
<cow_2001>oh wow. i am behind the times.
<old>Yes everything about port is there
<cow_2001>it is some sort of a debian derivative distribution
<old>Execpt socket
<cow_2001>oh oops. you meant the section in the book, not the book version
<old>Yes section of the book
<old>I'm at 3.0.8 latest Guile available
<cow_2001>too many dot separated numbers flying around in this channel!
<old>Btw here's an another version of popen: https://paste.sr.ht/~old/221d536c066a95647c9988ce835f5a36e18bafd3
<cow_2001>okay, reading the bit
<old>It's from Guix.
<old>You might not understand everything in the paste yet (e.g, dynamic-wind) but as you can see, one can implement popen in 20 lines
<old>And it really helps to go read the source code to understand
<old>I would advice to sometime go read the implementation of a procedure you have difficulty with in the source code of Guile directly
<cow_2001>opened textual-ports.scm
<old>Yes!
<old>70 lines. Soooo easy read and learn that way
<old>s/easy/easy to/
<cow_2001>but i will read the manual first because i know nothing about guile input and output
<cow_2001>thank you!
<old>Yes ofc. But you have to see the manual as a reference not a tutorial even though it has plenty of example in it
<old>When in doubt, I read the source code to understand better
<cow_2001>i've tried paredit and gotten all the parentheses messed up when i tried moving around ~_~
<old>You've installed emacs?
<cow_2001>turned it off. maybe will learn it later
<cow_2001>yes
<cow_2001>and geiser
<old>okay. There's some adjustment to make in your way of coding to adapt to how paredit works
<old>But once it's learn it's there for ever
<old>like biking
<cow_2001>a lot of this manual has a lot of good prose. it tells a story.
<nckx>Does anyone here use paredit for realsies, and if so, how do you deal with the unspeakable things it does when you comment out sexps with #; ?
<nckx>That alone makes me think I must be holding it wrong, this can't be anyone's idea of a useful tool.
<old>nckx: realsies?
<nckx>Totes.
<cow_2001>hmm. is there an equivalent to python with statements in guile?
<cow_2001>i don't quite understand what this sentence is trying to say. "and soft ports, for arranging to call Scheme functions to provide input or handle output."
<cow_2001>oh, a few paragraphs in and it says there are more idiomatic procedures that close ports automatically
<old>nckx: For commenting s-exp, I do mark + paredit-forward + paredit-comment-dwim
<old>lispy for emacs-lisp do it better imo. ; is bind to comment next s-exp
<nckx>Thanks. That's a lot of work.
<nckx>Well, by whiny nerd standards.
<nckx>Whenever I absent-mindedly type ???#;??? (it doesn't get more efficient than 2 keystrokes) I feel like a trap is sprung on me for unexplained reasons.
<nckx>It then gets worse when it won't let me delete the ???#;??? without jumping through hoops. That's often the point where I get fed up and M-x paredit-mode it back off.
<nckx>Everything else is a breeze.
<antipode>cow_2010: Currently, there isn't, to my knowledge y
<cow_2001>by the way, how did you all get into guile? how did you learn it?
<antipode>(a dynamic-wind out-guard is problematic w.r.t. using continuations for scheduling)
<antipode>You could, however, define a (with-cleanup (lambda (resource) [do stuff with resource]) (lambda (resource) (destroy it))) construct,
<antipode>(I mean procedure)
<antipode>in terms of exception handling.
<antipode>I think it would be nice to have such a thing in Guile, even if (IIRC) there currently would be various small imperfections with such a thing.
<Zelphir>cow_2001: I started with SICP and Racket (but did not work through the whole book yet, "only" 40%). Then at some point started learning GNU Guile. Although I have to admit, I had a good prof once, who showed "dr scheme" back then to us and I did remember that, when I started with SICP.
<Zelphir>antipode: What makes a dynamic-wind out guard problematic for that use-case? That any "exiting" would trigger the out guard, even when one only wants to switch to another "job" and the out guard might destroy things, so that one could not return?
<antipode>Zelphir: yes, exactly!
<Zelphir>Ah OK, thanks^^ Seems I did understand a little at least about dynamic-wind :D
<cow_2001>okay. now you are making stuff up. came across "fluids" data type. ~_~
<cow_2001>i guess i really should maybe at least skim (heh) the API Reference chapter top to bottom
<sneek>dsmith: wb!!
<dsmith>When I'm editing guile code with paredit, and I type #; in front of an expression, it moves any following close paraens to the next line.
<dsmith>It "just works"
<antipode>dsmith: In at least my personal style,, moving the close paren to the next line is a 'bug'.
<dsmith>The open-{input,outpt}-pipe direction always confuses me. It's from the perspective of the caller of that, right? NOT from the perspective of the thing piped to/from
<dsmith>antipode: Ya, actually it shouldn't matter, but I think paredit is seeing the ";" meaning comment to end-of-line, so it moves the parens.
<antipode>It's my hypothesis too.
<dsmith>But I'm ok with it.
<dsmith>If things get too messed up in paredit, undo works. And if necessary, just disable paredit, fix things by hand, and re-enable