IRC channel logs
2022-12-27.log
back to list of logs
<whereiseveryone>We have a matrix room for Guix Days moderated by Pjotr Prins in case you want to chat with people that will be involved there in person <mfiano>Ah I thought it was going to be like a jitsi thing or something <mfiano>Ah so you are jgart aka jgarte aka all the other accounts I keep blocking on github <mfiano>Can someone that has wrapped a C library with Guile before help me dig into these bindings to figure out which version of the API it wraps? <mfiano>SDL is pretty old. Infact, it is usually called "SDL2" due to the major API change like...15 years ago? <mfiano>Not to mention any minor version that has significant changes <whereiseveryone>Maybe try contacting one of the listed authors directly via email. See the git log maybe <mfiano>"This is alpha code (pre 1.0 release), tested with various, but not all, versions of Guile and SDL. It may have bugs, and the interfaces may change from version to version." <whereiseveryone>> It may have bugs, and the interfaces may change from version to version." <whereiseveryone>oh I forgot about that one. I actually had come across that one before <mfiano>That one was not listed on the .mn site <mfiano>Yeah, now to find out if it supports the ~1 year old floating-point "FRect" struct, or if only the integral "Rect" struct and related functions are wrapped. <mfiano>If I can't do subpixel placement, it's pretty useless for most things :) <mfiano>and the answer is "no", but the code looks plenty hackable and extensible. <mfiano>Ok, so if I side-step my normal GL way of doing things, and add a tiny bit of guile-sdl2 functionality, I can cheat and use Guile for graphics even. <daviid>mfiano: for 'graphics' you can use chickadee and/or the GNOME stack with g-golf or guile-gi <daviid>mfiano: then define 'graphics' but you might want to look at aiscm and guile-cv as well ... <mfiano>Low latency, real-time game engine kind of graphics. I am aware of chickadee, but it is a set of choices that I can't control when developing a low level game engine. <mfiano>So I will just build off of the underlying guile-sdl2 likely <daviid>there is anothyer game engine in guile, but i forgot its name <daviid>lilyp: don't you you have a game engine as well? <lilyp>daviid: visual novel engine tsukundere <lilyp>mfiano: fwiw, there is guile-opengl, which is used by chickadee <mfiano>According to the documentation, guile-opengl only wraps 2.x, which means using the fixed-function pipeline. <mfiano>"modern gl" didn't really start until around 3.0, finalized in 3.3 <mfiano>where "modern" is like 20 years old now. <mfiano>In Guile, do symbols with a colon in them hold any significance, or is it only part of the name and a convention to separate the prefix? <mfiano>Curious if there is any parsing difference or whatnot like there is in CL. <nckx>Pretty sure it's not magical. <lloda>yeah : by itself doesn't do anything. Guile keywords are start with #: <lloda>nearly all of the reader syntax i can think of is #something <nckx>That's my understanding! # is the portal to magictown. <mfiano>well I mean the manual has things like procedure passwd:dir <mfiano>lots of things prefixed with something like that. Just wondering why some things are, and what it means. <lloda>those are just conventional, like *parameter* or predicate? etc <mfiano>ok, what does this particular convention mean? I asked some other schemers and they said it's not typically seen. <mfiano>SO I assume it is a guile convention. But I still don't know why it is only sometimes used or what it even means. <lloda>it's an adhoc convention. Compare char-set:xxx which are names of charsets vs char-set-xxx which are functions that operate on charsets <lloda>i cannot assure you that it's always used consistently or with the same meaning <mfiano>Yeah, that's what I gathered by "adhoc". Makes sense...context or comments should explain the difference in each case. <mfiano>Thanks. I learned a bunch today. Trying to come at this by forgetting most of CL and asking dumb questions like this. :) <a12l>rekado: Thanks for the function defs. yesterday! <plasma41>whereiseveryone: That's exactly what I was after, thank you. <whereiseveryone>a12l: that terminology is a bit confusing and I also think that the examples in that doc are not the best <whereiseveryone>it is an alternative way to implement the basic concept of what you do when you curry a function <a12l>Is it a synonym for parameters? Or is `cut` a special form, and we have other terms for "arguments" to those? <a12l>I thought Scheme did partial application automatically <a12l>Guess that I'm still to used to Haskell's behavior when writing Scheme. <whereiseveryone>install-file is a procedure that takes a file name to install as its first argument <whereiseveryone>in this example, we loop over all the cpp header files in the current directory and install each one <whereiseveryone>the <> symbol is syntax for where to place the cpp header file argument <whereiseveryone>So you end up with a call to install file like so: (install-file <> ...) becomes (install-file foo.hpp include) <whereiseveryone>in the example, include is a string variable defined in the above let* block that represents the file path that we are installing the cpp header file into <whereiseveryone>that outputs is pretty abstracted out from that code context in the greater system <a12l>whereiseveryone: Thanks a lot for your explanation! Really helped me :) <whereiseveryone>I would look for other code examples of cut and cute that are not the guile manual <whereiseveryone>srfi-26 in practice is a way simpler concept to understand than how it is being explained in the guile docs <whereiseveryone>I might try to find the time to rewrite it if people are open to a patch for that? <whereiseveryone>Should the guile docs also mention known foot guns or bugs in certain systems that are not complete? For example, goops? <whereiseveryone>It's from October 05, 2022 so relatively recent information unless you're very familiar with the goops code from personal experience hacking on it in the past <singpolyma>Oh I see, using goops for class-style oop with inheritance <a12l>What I can't figure out is how to express the pattern to match "the first letter is either G, C, T, or A" <a12l>Most probably, I'm very much in the beginning of learning Guile :P <a12l>I actually haven't tested to run it, because I know it's not finished <a12l>Get an compiler error when I try to run it <whereiseveryone>it infinitely loops I think because when you recurse with the string you also always (string-append "C" ... <whereiseveryone>so you never get the empty string if you pass in one of the valid strings that you specified <singpolyma>whereiseveryone: isn't that the question though? They want to know how to get the first char off the string <singpolyma>I am under obligation to point out that characters don't exist and you can't loop over them, but otherwise I think that's the question <a12l>It's partially that, and but I'm also bit supprised <a12l>Because I'm recursively calling `dna->rna` with the tail of the string? <whereiseveryone>mfiano: has anyone ever tried to implement alexandria in scheme or does it make sense to implement any part of alex given that it is meant to supplement the CL spec? <lilyp>a12l: how about a string-fold instead? <whereiseveryone>I can get behind why a C programmer might think that strings don't exist... <singpolyma>whereiseveryone: Unicode has several different things people call "characters" but there is no definition for the word itself <singpolyma>Some people mean code points, some mean grapheme clusters, neither is a unit you want to operate in often but both are things people often think they need. <lilyp>also, it loops infinitely because your code is not tail-recursive – that means it actually needs a stack <lilyp>that plus you're always just taking the first element, i.e. ("ACG" → "A" → "A" → ...) <a12l>whereiseveryone: Let `dna` be a string consisting of the letters `A`, `C`, `G`, and `T`; or be the empty string. If it's the empty string the function should return the empty string. Otherwise it should return the "matching" letter for the letter (`U` for `A`, `G` for `C`, `C` for `G`, and `A` for `T`) and the result from running `dna->rna` over the rest of `dna`. <a12l>Hope I expressed it clearly enough :) <a12l>lilyp: What would I need to do to make it tail recursive? <a12l>whereiseveryone: I've written that code pretty much as a "translation" of the haskell function I would have written, but I'm not sure if that's possible in Scheme. <a12l>string-map seems to be very fitting. <lilyp>it's not bijective, but C should map to G ;) <a12l>Seems that I should use string-map for this. <a12l>But would it have been possible using pattern matching as I thought? <a12l>Or is it tail recursion that stops it from working (in a nice way)? <a12l>lilyp: Could you please write an example solution, so I can see what I did wrong? <a12l>Thanks! So "pattern matching" in Scheme works as if pattern matching and guards in Haskell would have one syntax for it. <lilyp>yep, provided that you can formulate your guard as a pattern <daviid>whereiseveryone: the blog is written by dthompson, not me :) - no i don't think its content should go in the manual - i don't think goops current state is a 'foot gun shot', i use goops extensively daily and still have my feet intact :) <daviid>i'd made a few coments if i had time, but a quick one to correct this: 'Generics cannot be merged outside of a module' - that is incorrect, yes they can <daviid>also, we have a define-method* 'out there', i should actualy add it to gule-lib, but let me paste <daviid>please read the comment lines 26 - 32, which explains that this code was written by Mark H Weaver <daviid>fwiw, gauche (which also based its implementation on stklos) got its slot inheritance right, in guile, it is a deliberate design (bug in my oinion, i agree with dthompson) it used to be properly implemented, but was changed somewhere arounf guile 2.0 or 2.2 i don't rember - i mentioned the bug, i was told it was a feature <daviid>iiuc, the main reason behind the 'no proper slot inheritance compsition' choice is speed - some very important improvments have been made by wingo in the last 10 to ..y, and 'proper slot inheritance composition' would break those improvments <daviid>it would be nice to 'keep the spead' for class-direct-slots and allow, with some slot access speed degradation, proper slot inheritance composition though - not sure it is possible, but i am definitely sure it would not easy to implement, otherwise wingo would have done it <daviid>i think we all wish to have before/after/around method qualifiers, not easy to patch those either though - they are not in stklos, and so never were part of the design - patching those is a bit like patching a house after it's been constructed, to make a change in the foundation of the building - not impossible, but difficult ... <daviid>there is another not mentioned (in dthompson's blog post) diff with the clos protocol, which is far more dangerous imo, which is that define-generic does not raise an exception if redefining an existing generic. unlike the procol asks for, in goops, it silently create a new generic and throw away all previously defined and added methods - terrible <daviid>i think patching to have doc string would probably not be that difficult - not offering to do this, i have no real interest (nor time) but i understand one would wish goops had those ... <singpolyma>Why should that be part of goops vs just all producers?