IRC channel logs

2021-01-03.log

back to list of logs

<fnstudio>hi, i'd like to create a simple game-of-life implementation and i was wondering if there was a library to help me with the graphic part
<fnstudio>ideally, i'd like this to be as much text-interface oriented as possible
<fnstudio>as opposed to a purely graphical library or a game kind of engine
<fnstudio>is ncurses something that could be stretched to cover this? (i.e. to display a grid of cells that get coloured alternatively, etc...)
<fnstudio>or maybe i should be creative and think of something like... i don't know... exporting to svg every single iteration and then look for a viewer?
<chrislck> https://www.gnu.org/software/guile-ncurses/
<chrislck>xpm is easier ;)
<fnstudio>chrislck: thanks, what do you think of ncurses for this? too much of a stretch?
<fnstudio>right, xpm over svg you mean, i guess?
<RhodiumToad>ncurses doesn't give you a very large resolution
<RhodiumToad>but you could certainly use it
<fnstudio>RhodiumToad: right... i was thinking that maybe it could be possible to use a large viewport (but maybe i'm wrong)
<fnstudio>chrislck: right, XPM would be very straightforward... i refreshed it from my rusty memory with the help of wikipedia
<fnstudio>although with svg/xpm/... then i'd need to figure out a tool to visualise things
<RhodiumToad>a gui version probably wouldn't be hard.
<fnstudio>RhodiumToad: cool, any library in particular that you think i should look at?
<fnstudio>just as a first pointer, if you have anything in mind
<RhodiumToad>g-golf and (iirc) guile-gi are gobject-introspection libs for guile that let you use gtk etc., or there's the old (but probably still ok for this use) guile-gnome
<RhodiumToad>guile-cairo exists for doing stuff with a cairo surface for the actual drawing, or you can use a canvas widget
<RhodiumToad>if you're on windows or mac I have no suggestions to offer
<fnstudio>RhodiumToad: that's a great tip, excellent, thanks! (and nope, i'm not on win/mac :))
<rlb>Hmm, I thought guile always supported (setlocale ... "ISO-8859-1"), but that's not working here anymore with 3.0.4, i.e. I have to specify "en_US.iso88581" or similar...
<RhodiumToad>the list of valid locales is up to the OS
<RhodiumToad>locale -a should show them
<rlb>Yeah, maybe that changed here -- for some reason, I'd thought guile special cased that one.
<rlb>It'd be handy to have a guaranteed portable "pass through" LC_CTYPE until we really fix the problem.
<rlb>(if we don't already)
<rlb>And iirc "C" isn't (really) it, since technically it doesn't guarantee that?
*rlb is talking about arbitrary binary paths again (wrt context)
<rlb>(so you can write portable apps with guile that won't crash on some paths)
<daviid>rlb: I think one should always catch the result of setlocale call in an app, and fallback to C, sending a warning to users ...
<rlb>maybe in the short run, or just exit with an error, but of course in the longer run, we just need to provide a way to handle binary data. i.e. tar can/should always be able to save/restore the correct paths.
<rlb>no matter what locales are available
<daviid>hum, is this even possible? but i thought you were talking about a guile app you were developing, that would be available in diff languages ...
***oni_on_ion is now known as oni-on-ion
<rlb>I'm talking about writing any general-purpose filesystem-related utility in guile. I imagine we'll eventually want to do something isomorphic with supporting byte-vectors in addition to strings in all the relevant functions like open, mkdir, etc. (i.e. that, or something functionally equivalent).
<rlb>Or rather, one way to do it is to just change all the relevant functions to take a string or a byte-vector.
<rlb>But that still leaves questions wrt what functions like readdir should return.
<rlb>Anyway, I believe it's been discussed, but not settled. I just thought I had a solid work-around with "iso-8859-1", but may have been relying on something that's changed locally or in debian, i.e. it's not special-cased/guaranteed in guile, apparently.
***berndj-blackout is now known as berndj
***unCork is now known as Cork
***wleslie_ is now known as wleslie
***janneke_ is now known as janneke
<leoprikler>Eww, ISO-encoded paths.
<leoprikler>Doesn't Guile automatically use the same character encoding as your system, which should be equal to the character encoding of your filesystem?
***apteryx is now known as Guest62057
***apteryx_ is now known as apteryx
<Zelphir>Hello :) I have a Scheme SRFI question: Why is `first` in srfi-1 but not `rest`?
<Zelphir>When I use `first` from srfi-1 and then use `cdr`, it feels a bit uneven.
<ZelphirKaltstahl>server irc.euirc.net
<spk121>i tagged a point release of guile-gi
***Formbi- is now known as Formbi
<Zelphir>(sorry, I wrote in the wrong text input)
<RhodiumToad>leoprikler: at least on unix-like filesystems, there is no such thing as "the character encoding of your filesystem"
<RhodiumToad>a filename is a nonempty byte string not containing 0x00 or '/'
<leoprikler>Well, sure, but filenames are encoded a certain way, usually UTF-8.
<RhodiumToad>only as a matter of convention
<leoprikler>If you have a filename that's not UTF-8 and it contains non-ASCII data, tools won't handle that well.
<RhodiumToad>and if some program expects filenames to be utf-8, there is still no guarantee that other programs will agree
<RhodiumToad>which tools?
<RhodiumToad>_sane_ tools will handle it.
<leoprikler>insane tools such as ls won't display the name you want them to display
<RhodiumToad>they will display the bytes of the filename. what that means is not up to them
<ft>Reminds me of my favourite cups bug (https://github.com/apple/cups/issues/2812). Closed wontfix, of course, because it works as designed...
<stis>manumanumanu: back pain blocks me from doing much now
<spk121>stis: :-( I know how that is
***jboy- is now known as jboy
<stis>but I play a little with riemann's zeta function for fun
<manumanumanu>stis: :( That stinks.
<manumanumanu>the human back is the worst.
<Zelphir>Back is like cable tangle – There is not a lot you can do against it.
<rekado> https://elephly.net/downies/guile-studio.png
<rekado>New version of Guile Studio
<manumanumanu>rekado: where can I read more?
<rekado>manumanumanu: https://git.elephly.net/?p=software/guile-studio.git;a=summary and https://git.elephly.net/?p=software/guile-picture-language.git;a=summary
<rekado>there’s no blog post or anything
<manumanumanu>thanks!
<a_v_p>rekado: Wow, looks nice. :-)
<rekado>the motivation is this problem: a motivated person wants to learn Guile. We tell them to use Emacs for the best experience, because it has Geiser.
<manumanumanu>"to install guile-studio, just use guix" :P
<rekado>The motivated person gets confused by Emacs and stops learning Guile because Emacs needs to be learned first
<rekado>manumanumanu: at some point I’d like to make it work without Guix, but… this is so tedious.
<rekado>maybe I should just dump a “guix pack” somewhere for download
<manumanumanu>I understand. I just thought it was funny
<manumanumanu>not to piss on your hard work. this really looks amazing
<a_v_p>The more I work in software development, the more I understand that software must be easy to use to be useful for the end users.
<rekado>(I also updated the picture language and documented more shapes)
<manumanumanu>I didn't know geiser could do that!
<rekado>I read in the geiser manual that it supports image display for Racket. Then I read the sources and realized that we could make Guile do the same.
<rekado>when a value prints as #<Image: /path/to/file.svg> Geiser will replace it with the actual picture.
<rekado>that’s all there is to it
<a_v_p>rekado: Recently I learned (to my surprise) that there is a course based on SICP in our local university (Lobachevsky University). They use Racket in classes.
<rekado>the picture language is a collection of sxml functions to generate and compose SVG snippets
<rekado>a_v_p: I think Racket is great for teaching
<rekado>when I saw the Racket picture language I knew I had to have it for Guile
<a_v_p>One UNN student asked me to help with a homework, and I used Emacs/GNU Guile in my examples. ;-)
<rekado>:)
<a_v_p>Yeah, Racket seems to be more user-friendly. I'd love to see Guile develop in that direction a bit.
<a_v_p>Thanks for your work on Guile Studio, rekado
<a_v_p>Guix is cool, but not so many people use it yet; and usually I recommend Ubuntu when a novice asks me what distro they should choose as the first, just because Ubuntu is IMO friendlier for the users than a great deal of other distributions.
<rekado>I uploaded a relocatable Guix pack: https://elephly.net/downies/guile-studio.20210103.pack.tar.gz
<rekado>inside is ./bin/guile-studio, which seems to work fine (haven’t tested all that much)
<Zelphir>guile-studio looks great. If I did not have a working Emacs setup with everything I personally need, I would install it right away and try it. Now if only we could expand macros like in Racket, inside guile-studio ... (or can we?)
<daviid>spk121: congrat for the guile-gi release!