IRC channel logs

2023-01-03.log

back to list of logs

<daviid>mfiano: why don't you (offer to) contribute to guile-opengl? it seems you have a far amount of experience and an opinionated opinion on what should be done as a high level interface - to be discussed with dthompson [not me] and/or wingo who started the project ... you keep saying it needs love, how about you start giving it some of yours ...
<mfiano>daviid: Yes, that was my conclusion the other day: that when I get proficient enough I should work on the graphics tool situation for Guile to bring it up to par.
<daviid>mfiano: great! but don't wait till ... just clone, create a branch wip-ogl-for-the-next-century and hack, then ask here to review ... all this can be done as part of your 'graphics tool situation for Guile ..'
<daviid>*for review
<mfiano>daviid: Sadly I don't have the mental capacity to work like that. I have too much floating around in my head to think about right now, both in terms of learning Scheme and applying it to the projects I eventually want to make.
<daviid>mfiano: then g-golf users may benefit from your work, as well as chickadee i guess ...
<mfiano>Maybe I am old. I am not as smart as some people might think though.
<mfiano>I really am going to stick with Guile though, and I fully intend to contribute when I get that far.
<Kolev>I wish there were more everyday applications written in Guile.
<Kolev>Too bad Guilemacs isn't mature.
<mfiano>I am slow learner, and I prefer learning by reading before doing, at least cursory. Scheme has a lot of high level concepts that CL doesn't, so the cursory reading is taking a bit of time, between other activities.
<daviid>forget about 'too old', you'll never (ever) convince me it is a barrier 'of any sort' - just work on things at your rhythm, but you keep mentioning opengl as a 'corner stone' of what you need to achieve your goal ... then clone and work on it, ask for review, early if design of a high level api is involved ...
<daviid>nobody here will dear judge(ing) you for how fast or not you ar to learn, forget about all this, just clone guile-opengl and start to think and work on it, share your ideas and ask for review ...
<mfiano>daviid: I completely agree. I will, definitely, when I know what I'm doing in Scheme a bit more :) I'm sorry if my comments came off as unappreciative or "this language is better than that". I don't think like that, and just meant that it would be nice to have one day, even if that someone is me, when I have the ability.
<mfiano>It's not a corner stone. I can work around it. It's just a "nice to have".
<daviid>Kolev: just start to write the app of your dream, now is a perfect time, as we have g-golf ... you may even write and it will work on mobile phones ...
<daviid>mfiano: don't 'work around it', help us to make it better
<mfiano>daviid: That particular project is a huge task, and not as big of a priority for me as you think, but it is already on my queue of things to clone and hack on, or if need be a new design like dthompson provided with guile-sdl2
<mfiano>I have a lot of "things I want to contribute" to Guile on my list so far.
<mfiano>Right now "learning Scheme" is at the top.
<Kolev>Exploring search-bar.scm.
<daviid>mfiano: of that list, the only item i heard of, from what you wrote (i may have missed some other items ofc) is guile-opengl, and how cl-opengk is superiror, and how late we are ... learning by doing, how about you start with one item of your list, the one you pointed here restless :)
<Kolev>I installed guile-g-golf but still cannot run search-bar.scm.
<daviid>Kolev: nice! i'd suggest you do as i just posted here earlier
<Kolev>daviid: What's that?
<dthompson>mfiano: here's that autotools boilerplate I said I'd do: https://gist.github.com/davexunit/05804cdd9357e5f30a66e3ca9fdf65db
<daviid>Kolev: please read yesterday's log of the guix channel, it will walk you to get the latest and run under guix
<Kolev>daviid: The package guile-g-golf is not good enough? Alas.
<daviid>no, totally outdated
<Kolev>daviid: What string will take me to the relevant posts from last night?
<daviid>Kolev: hum, very unfortunately, no logs, the logs had a problem, let me see if i can grab the chat and paste it for you
<daviid>Kolev: give half an hour, i need to jump on something else, but will bebback
<Kolev>daviid: I have logs. I just need to know what string to search my logs for.
<mfiano>dthompson: Thank you! I will inspect this probably tomorrow. Heading out shortly. I did have a question about all this though in the meantime.
<mfiano>I forgot who, but someone here told me that autotools is completely unnecessary if you're writing pure scheme, which I plan to do, and that guix can do everything all that boilerplate does to install guile libraries in the load path etc. I didn't give it much thought yet, reading TSPL4, but seems like I need more information to make a choice :)
<mfiano>Though it looks like the boilerplate is not much. I won't get to play around with it until tomorrow though. Thank you, night!
<daviid>mfiano: although, if anythig you do you'd like other distro to also have, you need the autotool chain set-up
<mfiano>daviid: guile runs on BSD, no? BSD make is not compatible with GNU make.
<daviid>Kolev: in the guix chats, ' ... hi how do I set up a guix shell to run the examples for g-golf? ...' and further below, till you have something that uses the lastest and works, even runs thye examples in the build subtree ...
<mfiano>(I run BSD on several machines, but I did not try guile on them yet)
<mfiano>Night all. I will read any messages tomorrow.
<daviid>mfiano: that's not the question, the question is if you want your lib/app to be in other distro, no mater which one, you'd need the gnu build system set-up - which i recommend, then as i told you already here, guix can take it and sshake it ... at ease ...
<a12l>What is a good way to traverse two strings, and count the amount of times there's different characters at the same index. E.g. if I compare the strings "foo" and "foa" the function should return `1`, and when comparing "foo" and "bar" it should return 3.
<a12l>Getting a function to be tail recursive doesn't seem to be that easy in Scheme, so I'm thinking of different approaches.
<daviid>Kolev: also, earlier today, i wrote here in #guile, '... have a quick then deeper look at the libadwaita ...' search and read, and apply this advice for yourself, if you are really serious about writing an app using guile/g-golf i mean
<spk121>a121: that sounded like fun. Here's what I got https://paste.debian.net/1265991/
<spk121>not at all optimum, obviously
<spk121>probably should have used substring instead of string-drop to not allocate a new string
<mwette>spk121: I have overkill string-diff in seqdiff: https://github.com/mwette/guile-contrib/blob/main/seqdiff.scm
<mwette>It returns a list of operations to convert a into b.
<mwette>(string-diff "abcd" "ac") => ((dup 0 1) (del 1 2) (dup 2 3) (del 3 4))
<spk121>mwette: nice!
<old> mwette: Neat way of calculating the hamming distance!
<Aurora_v_kosmose>Guile assumes modules are defined in a single file, right?
<Aurora_v_kosmose>Or is there some pattern similar to the CL #'in-package?
<spk121>Aurora_v_kosmose: guile modules are single file. I think R7RS packages can be more than one to a file? And if you really really wanted to, you could split guile modules into multiple files by playing with 'module-define!', but, not recommended
<Aurora_v_kosmose>Alright, nice to have that confirmed.
<lilyp>Aurora_v_kosmose: you can cheat, but you have to be very smart about it
<lilyp>module system reflections allow you to define your own modules, but you need to do so before attempting to load them
<daviid>sneek: later tell akirakyle i am looking at why, in your example, the define-vfunc fails, i can reproduce the bug, will let you know when i find the cause and a fix ...
<sneek>Okay.
<Aurora_v_kosmose>lilyp: Ah alright. It's fine, I was just asking as I needed to decide how to structure my repo.
<rekado>daviid: logs were appended to the previous day’s file
<ArneBab>sneek: later tell dthompson: is it known that the new version of chickadee fails when trying to load-image with non-indexed colors?
<ArneBab>failed: free_flat_tiles_spritesheet.png: PNG image data, 1792 x 1792, 8-bit/color RGBA, non-interlaced
<ArneBab>succeeded: free_flat_tiles_spritesheet_rgb.png: PNG image data, 1792 x 1792, 8-bit colormap, non-interlaced
<sneek>Got it.
<ArneBab>sneek: botsnack
<rekado>daviid: g-golf 0.8.0-a.1 fails to build for me. Says “gi_type_tag_extract_ffi_return_value” is undefined.
<rekado>I’m using gobject-introspection 1.66.1
<daviid>rekado: ah, i patched the devel branch, you need 1.72.0 or later ...
<daviid>i will release 0.8.0-a.2 soon, but i need to fix another bug 1st ...
<lloda>the way fold, vector-fold from srfi-43 and string-fold from srfi-13 each use different conventions is unfortunate. string-fold in particular is weird
<flatwhatson>if you think those are unconventional, you should see file-system-fold or foldts* :P
<flatwhatson>also worth mentioning vector-fold from SRFI-133, now without an index argument
<lloda>srfi-133 looks like the best definition of them all tbh
<KarlJoad>Would implementing a Calibre-like tool for academic articles be a reasonable thing to do in Guile? I expect to need a database (so I do not have to track PDFs myself) and the ability to export Bib(La)TeX citations.
<sneek>KarlJoad, you have 2 messages!
<sneek>KarlJoad, lechner says: / this is my config plus MTA-STS and a lot of DNS records related to DMARC and DKIM. here is my mail config https://codeberg.org/lechner/system-config/src/commit/ce37badb89e6362f74ad8d061d0c44248b1fc1e5/host/linode/operating-system.scm#L78-L104
<sneek>KarlJoad, lechner says: / and here is my DNS including SPF and MTA-STS, the latter of which is served separately via Nginx https://codeberg.org/lechner/system-config/src/commit/ce37badb89e6362f74ad8d061d0c44248b1fc1e5/host/wallace-server/operating-system.scm#L58-L65
<old>KarlJoad: I used org-roam for that, except for exporting bibtex citattions
<dthompson>KarlJoad: sounds doable to me
<sneek>Welcome back dthompson, you have 1 message!
<sneek>dthompson, ArneBab says: is it known that the new version of chickadee fails when trying to load-image with non-indexed colors?
<dthompson>ArneBab: yes, next release will fix that.
<dsmith-work>Happy New Year, Guilers!!
<dsmith-work>sneek: botsnakc
<dsmith-work>sneek: botsnack
<sneek>:)
<dthompson>happy new year dsmith-work!
<dthompson>ArneBab: wait, did you mean "indexed" instead of "non-indexed"? because non-indexed should work as that's what most PNGs are, and what I use, and I've loaded many many PNGs.
<count3rmeasure>how often do folks actually use association lists around here, in real world?
<KarlJoad>dthompson: Awesome. I was considering using other languages too, but the REPL embedded in the final product could be useful when developing higher-level interfaces (Emacs interface).
<count3rmeasure>real world code, I mean. Like, practical code
<Aurora_v_kosmose>count3rmeasure: They're useful for configuration files and other things that must be human-readable.
<count3rmeasure>interesting, thank you Aurora_v_kosmose, appreciate the insight
<dthompson>count3rmeasure: I use them all the time, a lot more often than hash tables.
<Aurora_v_kosmose>Hash tables tend to be worth it when performance starts to matters.
<dthompson>for situations that call for mutable things, yeah
<dthompson>most of the time alists are great, though.
<count3rmeasure>thank you for these answers!
<count3rmeasure>for my own use case performance doesn't matter, the amount of values and keys is quite small
<count3rmeasure>basically munging a table and turning it into a data structure I can query or feed to another pair of functions
<count3rmeasure>6 columns and about 40+ rows
<mwette>use a-lists where you want immutable dict: (define x '((a . 1) (b . 2))) (define y (acons 'b 3 x)) ; (assq-ref x 'b) => 2; (assq-ref y 'b) => 3
<count3rmeasure>thank you mwette
<dsmith-work>You can (read) an alist. Hashes (in Scheme) don't have a read syntax.
<dsmith-work>Wooo. Logs are back up!
<dsmith-work>I mean for 2023
<count3rmeasure>haha I was wondering about that, the logs I mean
<Aurora_v_kosmose>It's interesting that grabbing a few bits of info from /sys or /proc is faster than calling C programs that query the same info & return it as text.
<dthompson>no process/pipe overhead :)
<Aurora_v_kosmose>Yeah, I just didn't expect code to be >10x faster that way.
<Aurora_v_kosmose>Not sure how reliable current-time & time-difference is for such profiling, but even if it's only approximate it's impressive.
<dthompson>that's a nice ratio
<Aurora_v_kosmose>Indeed.
<Aurora_v_kosmose>I found a typo in the guile manual. (rnrs condition (6)) should be (rnrs conditions (6))
<mfiano>dthompson: Does goops' mop allow you to modify the superclasses of a class such that all existing instances of that class are updated?
<dthompson>mfiano: yes, but by default class instances are not updateable. use the <redefinable-class> metaclass and you'll be good to goops
<mfiano>Interesting. CLOS doesn't have anything like that. Any idea why that split?
<Aurora_v_kosmose>It does not?
<mfiano>No, I mean the CL MOP does not.
<Aurora_v_kosmose>I see.
<dthompson>mfiano: wingo made the change to the default to remove a layer of indirection and speed things up when runtime redefinition is not needed.
<mfiano>I assumed so, great. Hey, I'm not complaining about more free stuff
<mfiano>Is there another resource besides the manual about working with the MOP?
<dthompson>not that I know of, it's a little underdocumented right now.
<mfiano>I know in CL it is black magic because all the good stuff is in ancient texts :)
<dthompson>whereas most CL people are using CLOS, not a lot of Guilers use GOOPS
<mfiano>I wonder why that is the case? scheme minimalism?
<mfiano>Guile's object system implementation was one of the top selling points for me, anyway.
<dthompson>it's just not often needed, really. I like goops a lot but most of the time I don't use it.
<dthompson>when you really need to start making things crazy flexible it's great, though.
<ArneBab>dthompson: see #chickadee
<mfiano>Ok, thanks.
<Aurora_v_kosmose>I use GOOPS from time to time, it's certainly nice to use.
<Aurora_v_kosmose>I've been using Guile more for scripting than other programs though.
<mfiano>I have a question about that scripting
<Aurora_v_kosmose>Ask away?
<mfiano>I was planning on rewriting a ton of my shell scripts, some tiny, some very large to scheme, after it became too annoying of a task with CL. I know Guile has great POSIX support, but are there any comparable alternatives that are suited to this task, start up fast, and run fast? Ideally I'd like to just stick with Guile for everything, but some of these shell scripts are called once per second to
<mfiano>update various things like window manager widgets, so if the startup and script takes 1s to run...that means a core in constant full throttle
<mfiano>Not that I expect it to be that bad, but performance is kind of important here, even on my beefy computer.
<mfiano>Currently looking at Gauche, but I don't know. Doesn't seem like much if any improvement here, even though it's goal is to fit this exact purpose.
<Aurora_v_kosmose>I haven't really messed with other Scheme implementations enough to really say. It used to be Racket was slower than current Guile, but so was old Guile.
<Aurora_v_kosmose>Both of them have in the intervening time greatly modified their runtime characteristics.
<mfiano>Ah ok. I don't know anything about the performance or startup time of the various implementations, because well, Guile was the only one that appealed to me to even try (besides Racket...been there a few times)
<Aurora_v_kosmose>But for the fastest startup, I'd essentially be only looking at those that compile to C. That however doesn't guarantee the fastest runtime performance though. And for long-running things, SBCL is probably faster.
<Aurora_v_kosmose>I chose to script in Guile rather than CL because deployment is simplified and most of my scripts just aren't performance-critical.
<mfiano>That makes it more annoying to use for shell scripts, unless they are precompiled and installed onto the PATH...I just wanted to add a shebang because my whole CL setup is a mess with all the autotools stuff it has to do, not to mention other stuff to get AOT to be scriptable _and_ fast.
<Aurora_v_kosmose>Yeah, for shebang only you've got the bytecode & interpreted Schemes that'll work seamlessly, and cl-launch on the CL side.
<Aurora_v_kosmose>Which doesn't always work perfectly.
<mfiano>Yeah, I think I'll just stick with Guile. My brief testing shows it to be fast enough (though I didn't try forking all the processes a decently complex shell script would entail)
<mfiano>and startup is crazy fast even with a bit going on in my ~/.guile
<Aurora_v_kosmose>Yeah, Guile 3.0 has done some really good work.
<mfiano>Yeah I am glad it is much better now.
<mfiano>I tried it about a year ago, and ran into a lot of crashes and bugs. Though, it wasn't even in Arch's repositories yet, only 2 was, so it must've been released not too long before.
<mfiano>It has been nothing but pure joy this time.
<mfiano>I'll probably implement one of the procedural graphics libraries I wrote in several languages first, which I have a feel for the kind of performance to expect with how many times I implemented it in whatever language.
<ArneBab>mfiano: you can make startup of Guile scripts instant: Create a module and run it directly instead of running the file. For example see https://hg.sr.ht/~arnebab/dryads-wake/browse/dryads-wake.w?rev=tip
<mfiano>I also want to help Guile's graphics programming community every little bit I can.
<ArneBab>exec -a "$0" guile -L $(dirname $(realpath "$0")) -C $(dirname $(realpath "$0")) -e '(module)' -c '' "${@}"
<ArneBab>(define-module (module))
<ArneBab>(replace module with the basename of your file)
<mfiano>Why the wrapper and not a shebang?
<ArneBab>because that avoids parsing the file: It directly uses the byte-compiled module if it is current.
<mfiano>I see.
<mfiano>Thanks!
<ArneBab>I did some performance testing to ensure that it is no problem: https://www.draketo.de/proj/py2guile/#sec-2-2-3-2-1
<mfiano>dirname and realpath are POSIX right?
<mfiano>I ask because I run not just Linux :)
<ArneBab>I think they are …
<ArneBab>if they don’t work for you, please tell me so I can make my tools more portable!
<mfiano>BSD has a lot of differences that always forced me to use POSIX sh scripts...without arrays or anything :|
<mfiano>Which is the whole reason I want to rewrite that pile of junk
<mfiano>Sure :)
<ArneBab>-e '(the-module)' is a shorthand for -e '(@ (the-module) main)'
<Aurora_v_kosmose>Ah, that answers my unasked question of why no entry-point was given.
<a12l>spk121, mwette: Thanks for your code examples!
<dsmith-work>!channels
<dsmith-work>!uptime
<sneek>I've been running for one day and 3 hours
<sneek>This system has been up 9 weeks, 6 days, 21 hours, 32 minutes