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 <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>maybe post a snippet in a pastebin with more context in case it's a simple bug that is trivial to fix <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>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>whereiseveryone: I get the same error with #t <old>whereiseveryone: There's also good examples in Guix source at `guix/build/utils.scm` <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 <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? <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 <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 <old>the return value is a port to the output of the last process <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 <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 <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 <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 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 <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. <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>mfiano: WDYT of Guix as an alternative package manager to quicklisp? <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 <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 :) <mfiano>It cannot, since it doesn't even have the same protocol. <whereiseveryone>but what are some of the conceptual similarities between CL's MOP and Guile's own MOP? <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. <mfiano>Dave Thompson answered this well. <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. <mfiano>I have known him for a long time. he helps run #lispgames now with us :) <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. <mfiano>Nw projects will probably be a combination of CL and Guile. <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>I meant that, new projects will be either written in CL or Guile, exclusively. <whereiseveryone>What sort of projects do you think that Guile would be a good candidate for? <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>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 <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 <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 <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 :) <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>Some projects of mine have never been published and are just experiments in software architecture and protocol design. <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 <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>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! <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>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 is a great package manager for Guile if that's all you need it for <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 <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? <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? <mfiano>I could attend, to give feedback from an outsider CL perspective, if anyone wishes :) <mfiano>Just ping me with whatever link whenever