IRC channel logs

2022-12-26.log

back to list of logs

<a12l>ah, thanks! I'm still not at all used to read s-expr
<cow_2001>little schemer is my favourite new book
<dadinn>hi all
<whereiseveryone>Are there any good examples for how to use guile pipes from existing source code that people can point me to?
<dadinn>I am getting warnings when I use this code: (format myport "~27c[B") saying that wrong number of `format' arguments expected 1 got 0
<dadinn>the docs say that when I am using ~27c then format would expect no arguments
<whereiseveryone>what exactly is myport?
<whereiseveryone>in your code context?
<whereiseveryone>maybe post a snippet in a pastebin with more context in case it's a simple bug that is trivial to fix
<whereiseveryone>s/more/full/
<dadinn>myport is in the context yes, it's a input port
<dadinn>I would assume if you replace myport with #t it should cause the same warning
<dadinn>myport really is a Qemu/KVM serial I/O port where I am trying to interact with a VM via expect macro
<whereiseveryone>Do you get the same warning with #t?
<whereiseveryone>I meant in my context so I can try to give advice knowing the lexical context for your example
<old>dadinn: Did you use `ice-9 format`?
<old>Default `format` is different from `ice-9 format`
<dadinn>old: ice-9 format, yes
<dadinn>whereiseveryone: I get the same error with #t
<dadinn>error/warning
<old>whereiseveryone: Look at the `invoke` procedure in https://git.sr.ht/~old/libpatch/tree/master/item/tools/run-benchmark
<dadinn>old: the docs I've referred to is for ice-9 format: https://www.gnu.org/software/guile/manual/html_node/Formatted-Output.html
<old>whereiseveryone: There's also good examples in Guix source at `guix/build/utils.scm`
<whereiseveryone>old: thanks! I'll take a look at those today
<whereiseveryone>much appreciated
<whereiseveryone>I feel like the guile manual could have a more dumb example of how to use pipes
<whereiseveryone>the current example is too complicated for someone being introduced to a guile pipe
<whereiseveryone>I just want the simplest dumbest TLDR but enlightening example so that I can understand the core concept, syntax, and usages of guile pipes
<whereiseveryone>practical usages for the daily working guiler/guixer
<whereiseveryone>maybe I'll write an example once I fully understand pipes
<whereiseveryone>but first I have to struggle before I write that for others
<old>dadinn: the warning is maybe a compile time one
<old>whereiseveryone: Right. Learn by examples is by far the best documentation you can have imo
<whereiseveryone>It's the only documentation I have so there's no choice but to do that but even better would be to have both
<old>btw by pipe you meant `open-pipe` and not just `pipe` right?
<whereiseveryone>which one is pipe?
<whereiseveryone>from guile-pipe?
<whereiseveryone>threading-macro?
<whereiseveryone>old: re documentation I'm thinking of the four types: https://documentation.divio.com/
<old>`pipe' is the systemcall pipe(2) which return a pair of (input . output) ports
<old>`open-pipe' is from (ice-9 popen) and works like Python popen
<whereiseveryone>I'm thinking of the analogue to bash pipe
<whereiseveryone>guile analogue
<old>oh so `pipeline'
<whereiseveryone>TIL
<whereiseveryone>thnx
<whereiseveryone>confusion is easy with this stuff ha
<whereiseveryone>foot guns
<whereiseveryone>I want pipeline
<old>look at the procedure called `init-uprobe' here https://git.sr.ht/~old/libpatch/tree/master/item/tools/run-benchmark for `pipeline'
<whereiseveryone>old I'm trying to refactor this line: https://git.sr.ht/~whereiseveryone/conf/tree/gnome/item/home.scm#L311
<old>You pass a list of list to `pipeline. Every sub-list in the big list is a command that get pipe to the next command
<whereiseveryone>cool
<whereiseveryone>I'll be back online in about 2ish hours
<whereiseveryone>gotta run
<old>the return value is a port to the output of the last process
<old>okay cya :-)
<whereiseveryone>but I'll check those resources
<whereiseveryone>If you think of anything else that is relevant and could be useful feel free to post it. It's much appreciated, I'm all ears, and I have an irc bouncer ;()
<dadinn>old: the warning is compile time one
<dadinn>old: sorry, forgot to mention
<old>whereiseveryone: https://paste.sr.ht/~old/3f610202e97e1c69210ffe8c1ceaef0532bc8f76
<old>I haven't include the notify-send example. But since you're reeusing your fortune quote for two process, I don't think you should use pipeline
<stis>Heu guilers!
<mfiano>I'm not a guiler yet :(
<whereiseveryone>mfiano: yes, you are in the sense that guile copied a sh*t ton from CL
<mfiano>But, I read the manual top to bottom, and I want to be soon. :)
<whereiseveryone>mfiano: There's also defmacro or define-macro in case you don't want to learn define-syntax or whatevs
<mfiano>whereiseveryone: Actually, no. I am not one of those in that particularly large subset of CL users that are smug enough to not see value in other tools.
<whereiseveryone>oh sure guile is a different tool from CL but I think it is beneficial to see some of the influences that Guile drew from CL. There's definitely influence from CL
<whereiseveryone>But Guile is not CL ya
<mfiano>I know that both CL and Scheme drew a lot from each other.
<mfiano>Infact, the introduction in the ANSI CL standard mentions Scheme influence.
<whereiseveryone>I mean that guile in particular drew a lot from CL
<whereiseveryone>I don't have a list of all the things but other CL people that are not smug and also use Guile have noted the same thing
<whereiseveryone>mfiano: have you seen this Guix channel? https://github.com/drewc/druix
<mfiano>But as far as Guile, it is primarily where I stopped because while I am not a huge OOP user, I do like CL-style generic functions, and Guile's CLOS-like GOOPS implementation was the one I really liked. Coincidentally, it is not the one most closely aligned with CL - that would be Chicken's COOPS, but, I think Guile introduced some new things I like, and the things it dropped might not be a big deal.
<whereiseveryone>fare and drewc hack on that guix channel
<mfiano>I have not. I don't use Guix though.
<whereiseveryone>Still interesting to check out that channel to see how they are using GOOPS in the context of Guix APIs
<whereiseveryone>atleast I found it interesting
<mfiano>Ok I might check it out.
<whereiseveryone>mfiano: WDYT of Guix as an alternative package manager to quicklisp?
<whereiseveryone>for packaging CL libraries, that is
<mfiano>I don't like quicklisp or guix, so "no comment"? :)
<whereiseveryone>a CL friend has solved the interactive experience of loading libraries in a guix shell in an interactive way similar to ql:quickload
<whereiseveryone>mfiano: you prefer just asdf?
<mfiano>I prefer CLPM
<whereiseveryone>and `git clone`
<whereiseveryone>ok
<whereiseveryone>I haven't used that one yet
<mfiano>It allows versioned dependencies where versions can be a git sha1/branch/tag or a particular quicklisp month or whatever
<daviid>whereiseveryone: guix does not use goops, guix is actually goops allergic, so to speak - here is the (best) channel where to ask goops related quiz, there are a few goops wizards here :)
<whereiseveryone>mfiano That can probably be easily supported in Guix
<whereiseveryone>daviid: I know that guix does not use goops but druix uses goops
<whereiseveryone>druix is a guix channel that uses goops
<whereiseveryone>daviid: https://github.com/drewc/druix/blob/ad1c15bd6e20375b83ce398416d0f16de0385ab5/druix/versions.scm#L33
<whereiseveryone>Guix System uses GNU Shepherd which uses goops though ;()
<whereiseveryone>daviid: does goops fully implement the MOP?
<mfiano>It cannot, since it doesn't even have the same protocol.
<mfiano>if you mean the CL MOP that is
<whereiseveryone>ya I mean the concepts in the MOP
<whereiseveryone>not the CL MOP exactly note for note
<mfiano>Not even close.
<whereiseveryone>but it has some mention of MOP
<whereiseveryone> https://www.gnu.org/software/guile/manual/html_node/MOP-Specification.html
<whereiseveryone>so what are the key similarities between CL MOP and Guile MOP?
<mfiano>Yeah it has it's own MOP
<whereiseveryone>but what are some of the conceptual similarities between CL's MOP and Guile's own MOP?
<whereiseveryone>where exactly do they diverge?
<mfiano>Well I think you are asking the wrong question, because GOOPS is not CLOS. I think the question should be, what is the difference between GOOPS and CLOS, and then from there, you can see the large portion of CLOS not implemented and therefor has no MOP extensibility defined.
<whereiseveryone>What is the difference between GOOPS and CLOS?
<mfiano>Dave Thompson answered this well.
<whereiseveryone>Can you link me to the log entry for that?
<mfiano> https://dthompson.us/issues-with-object-oriented-programming-in-guile.html
<whereiseveryone>ah ok blog post great
<whereiseveryone>thanks I'll read that
<whereiseveryone>TIL
<mfiano>Sure
<whereiseveryone>That said, I don't know the CL MOP very well. Still green on that, so not sure if I will be able to make great comparisons with CL just yet until I do
<mfiano>Dave gets some things slightly wrong about CL, but it doesn't detract that much from his points.
<whereiseveryone>cool, I'll keep that in mind. Thanks
<mfiano>I have known him for a long time. he helps run #lispgames now with us :)
<whereiseveryone>cool
<whereiseveryone>mfiano: I read your blog post that mentions the toxicity of CL communities in the past and lack of good documentation. I whole heartedly agree with improving that.
<whereiseveryone>I think the CL community is slowly getting more friendlier but I am more interested in making Guile even more user friendly akin to Julia and Rust communitiy culture
<mfiano>Eh, my blog posts probably shouldn't be taken too seriously. I also said I was done with CL in them and moved to Julia...but screw that.
<whereiseveryone>That is, if we can mirror that in such a small community as Guile
<whereiseveryone>screw Julia, you mean? or something else?
<mfiano>Yes
<whereiseveryone>no more Julia?
<mfiano>No
<whereiseveryone>Guilia now?
<whereiseveryone>or dog fooding it first
<mfiano>Nw projects will probably be a combination of CL and Guile.
<mfiano>New*
<whereiseveryone>cool
<whereiseveryone>How are you planning to integrate Guile in CL projects? Or you mean that you will be developing projects with Guile and CL mostly but not together?
<mfiano>Oh no.
<whereiseveryone>Oh no to the former?
<mfiano>I meant that, new projects will be either written in CL or Guile, exclusively.
<whereiseveryone>ah ok th latter
<whereiseveryone>s/th/the
<whereiseveryone>got it
<whereiseveryone>What sort of projects do you think that Guile would be a good candidate for?
<whereiseveryone>versus CL
<whereiseveryone>I guess that also is a question directed in the context of your own use cases for those two languages
<mfiano>That's a good question, and one I can't really answer until I get in the weeds of Guile coding, but one thing that immediately stands out, comes back to a different between GOOPS and CLOS that affects what kinds of code you can write.
<whereiseveryone>Since you have particular domains that you will be using them in
<whereiseveryone>So you're planning to use GOOPS over other approaches that Guile offers to designing or combining approaches
<whereiseveryone>For example, Guix code prefers to use records and then more nested records for everything
<whereiseveryone>I'm referring to the lower level parts of Guix in the guix/ folder
<mfiano>CLOS generic functions enforce lambda list congruence, meaning, the arity of all methods must match, because in CL, the concept of a generic function is thought of more than just a collection of methods - it defined a strict protocol for consumers, and the signature is the interface to that protocol.
<stis>I use guile a lot in a few explaratory projects as I know how to mid the VM. This year I
<mfiano>In GOOPS, this is not the case, so you can have some freedom to create some interesting libraries, without redefining a lot of CLOS yourself by modifying it with the MOP
<whereiseveryone>ah ok, so lest MOP hacking is required with GOOPS? TLDR
<mfiano>So I think Guile can at least be used for quicker prototyping in such cases, and maybe even makes more sense to lean on this feature, just like the examples in the manual do
<stis>ve played with boosting hastables and generaters like in python. My experimental generator framework is twise as fast as CPython's
<whereiseveryone>mfiano I think that one pain point of Guile is that it's debugger is not as nice as CL's debugger
<stis>pk is all I need ;-)
<whereiseveryone>I think that CL is way more interactive in that regard
<mfiano>Sure, no language's is imo.
<whereiseveryone>pk is all you think you might need but try CL for a while then you will want more than just pk lol
<mfiano>There will never be a silver bullet language. I just put the tools in my toolbox and use whatever I feel is most appropriate :)
<whereiseveryone>right the right tool for the job
<stis>also amzingly scheme warnings is very helpfull and I finde schem a nice midle ground between python like lan and stuff like java
<stis>CL is probably in the scheme camp as well
<stis>A difference I noted is that scheme programs is often much more in funcitonal style the CL stuff
<stis>set! u´is usually code smell in scheme but not in CL in my experience
<stis>Also there is much more usage of loop macros in CL but in schem the named let seam to be more used although there is libraries that implement the loop macro or better versions of it e.g. iterate
<mfiano>That's another thing. I don't really care what is common to do in whatever language. I like a language that gives me the freedom to code how I want. Mixing OOP or other paradigms in if I need them is one of those freedoms I like. Infact, I am often not as interested in the artifact, end product, etc, more than I am than exploring different software architectures to see what works best in different
<mfiano>situations.
<mfiano>Some projects of mine have never been published and are just experiments in software architecture and protocol design.
<mfiano>I am weird, probably.
<stis>a full featured tagbody is also possible but I believe the generated code is way too slow and does not optimize as good as CL does
<stis>No, not weird if you ask me, I like to play as well, i like guile as I know the VM and JIT and know how to try out constructs myself
<mfiano>Cool. Unfortunately, I am not a C programmer. My programming experience mostly consists of a couple decades of Lisps and other garbage-collected languages. I toyed with Rust for a year, but it's not really my style.
<stis>that's why on my machine with a modified guile runtime, I can have python code that is faster than Cpython for generators vie guile-python lang ontop of guile
<stis>also those generators should be deep copyable in a reasonable way, which is cool I think and not something python supports
<stis>I like C and the abilities to use vector ops to for example speed up write with a factor of 20 many times.
<stis>that's also a project I made this year.
<stis>this is a library you can use if you like and are able to compile it
<mfiano>I do have a question about guile coding
<stis>shoot
<mfiano>I toyed with Guile briefly a year ago, and it was very hard to get other guile libraries to work, mostly because there wasn't a defacto standard way to set up a project manifest and stuff. I tried Guildhall I think it was, but I couldn't even get _that_ to build. How does one get an actual project set up that other people can use in their own projects in the most effective/productive way?
<stis>The most effective way i do not know, but you can copy and modify the utilities structure etc in e.g. wingo's fibers project and then have your own version adapted on it. That's what i did
<mfiano>fibers project?
<mfiano>Oh I see
<stis> https://github.com/wingo/fibers
<singpolyma>mfiano: guix to get packages
<mfiano>Is there a tutorial on using guix for guile packages, without getting deep in the weeds of guix? I know next to nothing about guix. I used Nix a while ago for packaging, but these days I use BSD where it doesn't make sense :)
<stis>I actually dont use guix but it is the simplest route for sure if you have it and one of the cooles projects out there regarding guile
<mfiano>Ok sounds like something to look into later then.
<mfiano>Gotta run for a while. Thanks for the chat and suggestions everyone!
<stis>o/
<whereiseveryone>mfiano: to use a guile library with guix is way too easy
<whereiseveryone>here's one way: `guix shell guile guile-pipe`
<mfiano>Ok still here for a sec, but where do I find guile libraries, and is there a blog or something explaining the basics for using it for developing guile software (not installing random system packages)?
<whereiseveryone>guile-pipe will then be auto-magically available to load in a guile REPL
<whereiseveryone>> not installing random system packages
<whereiseveryone>what do you mean be that
<whereiseveryone>there is a guile list that a friend shared with me once but it is probably not up to date
<mfiano>using it in place of my operating system's package manage...ie; non guile source code
<whereiseveryone>you can also just do the following `guix search guile-` to search for all the guile packages in Guix
<whereiseveryone>Guix has a ton of guile libraries packaged
<whereiseveryone>ah ok got you
<whereiseveryone>Guix is a great package manager for Guile if that's all you need it for
<whereiseveryone>mfiano: here's one list of guile libraries: http://sph.mn/foreign/guile-software.html
<whereiseveryone>mfiano: if you need a json parser there's really only one choice unlike CL: guile-json
<whereiseveryone>guile-json is a dependency of Guix so the Guix project is using that one.
<whereiseveryone>web stuff (http client, server) is built in to the guile standard library
<mfiano>I mostly do low level traditional AI/math algorithm programming, but I also am know to set up elaborate interactive graphics visualization (opengl 4, etc) tools for exploring them
<whereiseveryone>mfiano: if you are on Debian, then guix can be installed with apt. One of the Guix maintainers and long time Debian developer maintains the Guix package in Debian
<whereiseveryone>not sure how easy it will be to get Guix on any of the BSDs though sadly
<whereiseveryone>I would look at the list I linked above and you might find what you need there otherwise it might not exist yet. You can also try searching GitHub and other random forges
<whereiseveryone>I don't think Guile has an "awesome guile" list iirc that is kept up to date
<whereiseveryone>Are there any other guile-related irc channels besides guile-steel?
<whereiseveryone>guile project channels I mean
<whereiseveryone>there's also #spritely
<mfiano>Oh dear
<mfiano>The only OpenGL bindings for Guile is GNU's Guile-OpenGL, which only implements the 20 year old GL 2.x API, and that is incredibly annoying to work with and slow.
<mfiano>Chicken Scheme seems to be ahead here. Hmm.
<whereiseveryone>mfiano: I guess you know now which language you'll be using if you want to do OpenGL hacking (cough CL)
<a12l>Is there a car function but for strings?
<a12l>And cdr for strings
<rekado>a12l: (define string-cdr (cut string-drop <> 1))
<rekado>(define string-car (cut string-take <> 1))
<rekado>this string-car returns a string
<rekado>if you want a char use this: (define string-car (cut string-ref <> 0))
<whereiseveryone>Hi y'all, a couple of weeks ago I mentioned hosting a guile core dev meetup to discuss how we can improve the guile debugger. I'm planning to be at Guix Days this year so I might just make that first meetup at Guix Days as a hybrid online/in-person
<whereiseveryone>Are people still interested in meeting up online to discuss the guile debugger and improvements that can be made?
<whereiseveryone>If so, would you be interested in the first online meetup also be part of Guix Days?
<whereiseveryone>My main interest in improving the guile debugger is to step through Guix code more easily loll
<whereiseveryone>wingo is going to be at Guix Days so maybe he is interested in participating in this meetup and giving us a quick tour/more context around the guile debugger with the other core devs?
<whereiseveryone>wingo: would that be possible with your schedule there?
<mfiano>I could attend, to give feedback from an outsider CL perspective, if anyone wishes :)
<whereiseveryone>mfiano: yes, that would be valuable feedback please do
<mfiano>Just ping me with whatever link whenever
<mfiano>I'm usually around :)