IRC channel logs


back to list of logs

<sneek>dsmith: Greetings :)
<dsmith>sneek: botsnack
<dsmith>sneek later tell daviid Did you get it working?
<daviid>dsmith: yes we got it working - on g-golf side, it was actually drawing 'in the back', because of a mistake on my side, a wrong append-* call gtk4 order ... whic i found thanks to the help of mwette here, earlier today ... - here a screen shot
<sneek>Welcome back daviid, you have 1 message!
<sneek>daviid, dsmith says: Did you get it working?
<daviid>dsmith: i wanted to ask you if you wouyld be happy to propose a complete patch to guile-cairo, with both new procedures, an updated entries in the manual and a test as well, as we did yesterday, reusing a cairo context pointer ... ? then submit it to guile-user, then i'd ask lloda to verify, push and make a release (which i can help with if necessary ...) as g-golf cairo depends on guile-cairo, and as guile-cairo is decades old and in
<daviid>literraly all distro, it would be very important to patch and release ...
<daviid>dsmith: here is the 'compete g-golf example - which i will add to the g-golf exampĺes/gtk4 list ...
<daviid>actually, wrong paste, just a sec
<daviid>dsmith: here
<daviid>dsmith: do you have a g-golf installed?
<daviid>mwette: ofc it is not that i am opposed to an evolution of guile-cairo, so it would use your ffi based implementation, at the very contrary, but thing is guile-cairo is ... 'the' guile cairo toolbox - so we need to coordinate between us and update guile-cairo, not having multiple implementtion 'here and there' ...
<mwette>Not sure what you mean, but I never urge peeps to use the ffi version of guile-cairo. If I were you and were planning to add i/f for cairo, I'd choose guile-cairo. The ffi-helper is there to generate quick implementations in the case where there aren't other solutions or existing ones suffer from bit-rot.
<daviid>mwette: one of the things is guile-cairo is autotool chained, and in literally all distro of this planet :), so we need to reuse all that and just branch/work on an updated version that would depend on nyacc/ffi-helper ... but from a user pov, it would remain clone/tarball install guile-cairo, then ./;./configure --prefix=/x/y/z; make; make check; make install; make install-html - then they grab a g-golf example and start to
<daviid>use guile-cairo as they already did using guile-gnome, gue-clutter ... just need to call (cairo-pointer->context (append-cairo snapshot ...))
<daviid>ah - i was writing while you wrote ... oki, i was hoping you'd be interested to help get a modern guile-cairo, which currently is a little bit 'late [1.10, they just released 1.17 ...]
<daviid>and we should defiitely use ffi and obviously use nyacc/ffi-hep to get started, they manually fine tune what needs to be ...
<mwette>To be honest, I don't want to work on that. I have too many projects going as it is. Trying to help with the debugger, mmap, sengmsg, etc. And of course the ffi-helper. Maybe a topic of discussion. There are issues like whether to work with text-extents as bytestructures or vectors.
<daviid>mwette: didn't mean you were 'urging to ...' - but i take this 'opportunity' to express my wish that you would participate to improve the current situation wrt guile-cairo, which is 'ok', but about a decade old compared to the recent 1.17.0 release ...
<daviid>mwette: ok, i understand
<daviid>same here
<daviid>but i think it would be relatively esy, i may find some minutes per dau to work on this ...
<daviid>or maybe dsmithy beats us
<daviid>:) who knows ...
<dsmith>daviid: Sure I'll try and come up with a patch. Not sure about testing though.
<dsmith>Some questions:
<dsmith>SO these should allow you to "round trip" a cairo context through a pointer and back again.
<dsmith>Is the pointer ever expected to come from somewhere else?
<dsmith>There is a finalizer, which I set to NULL. I wonder if that needs to be something else?
<daviid>dsmith: test is impotant because playing with pointers crashes guile when not working, so i would just propose a test that does what we did yesterday: make a surface, make a context - then call context->cairo-pointer and cairo-pointer->context - if those 'simple' tests pass, fine ...
<daviid>dsmith: not sure, i prefer you ask lloda or wingo
<daviid>dsmith: but i'd be happy if you install g-golf, drop the example we worked on, chmod a+x, then cd /where/the/ex/is; ./simple-paintable.scm ... and you'd get ready to test any other guile-cairo improvment we may work on in the fuure, or just have fun 'for yourself', cairo is really fun to work with ...
<haugh>Hey guilers, I'm having some syntax trouble. not getting any pings on #scheme; figured I'd post it here for giggles. I appreciate any thoughts.
<daviid>dsmith: it also would be 'the ultimate' test of the patch you'd offer
<daviid>*of/for the patch you'd offer ...
<daviid>dsmith: about the location of the two new procedures in the guile-cairo.c, i added them after cairo_svg_version_to_string, because that is where lloda initially added its own version to 'start with' ...
<daviid>but ofc to be discussed with lloda ... just giving a feedback to your related post here yesterday ...
<mwette>haugh: not sure what you are trying to do. Your ellipsis patterns look wonky.
<haugh>mwette, I want the same output from the first set of M invocations, but from one invocation, and resulting in one list. Is that clear?
<mwette>maybe two macros? (M1 0 1 2) => ((0 1) (0 2)); (M2 X Y Z) => ((M1 X) (M1 Y) (M1 Z))
<haugh>Yes, that's a workaround, but I'm trying to understand the expansion-time error. At first I thought that the (N O ...) match was somehow setting the number of O patterns matched, but that doesn't explain why (M2 (0 1)) works while the others fail with only one clause.
<haugh>mwette, good intuition to name them differently. And thanks for your time.
<mwette>haugh: maybe something here to explain:
<daviid>mwette: something i also wanted to ask, both the gtk4 and g-golf example, ofc as they use the exact same cairo code, but then it seems in your version as well, the nuclear icon north-west 'blade' lower line looks 'curved', i wonder why - or is it a illusion ?
<mwette>daviid: I think that's just resolution issue. If you blow up the image you may see it.
<abcdw>Can someone share a good, but simple ffi example, please? I already skimmed through the manual, but would like to see some real-world examples with good practices. I try to wrap tree-sitter
<abcdw>The primary challenge right now is that there are a lot of structs, which I need to represent in guile somehow, to be able to retrieve them as a function return value and pass to other C functions.
<wklew>abcdw: the docs are a bit lacking, but the main gist is you define the type of your struct as a list of types (base types like int, or other struct types) and then use make-c-struct and parse-c-struct to embed convert them to and from C
<wklew>the part that took me a while to figure out (because it's not mentioned in the manual) is that this is how you pass structs by value, and you can use your struct type (the list you defined earlier) in the return-type and arg-types params of pointer->procedure or foreign-library-function.
<wklew>I can share some code tomorrow, I've been working on guile bindings to harfbuzz with the FFI
<daviid>harfbuzz is instrospectable, so you should be able to use it with g-golf
<daviid>thatis how the harfbuzz team 'himself' generates the python bindings -
<wklew>I looked into that a bit, but my impression was that's only if you use it with gnome?
<cow_2001>i don't like ,describe const. it is lacking.
<daviid>wklew: to make it as short as possible, there is nothing you will be able to do writing your own binding manualy (which is totally crasy) that you wouldn't be able to do using the harfbuzz typelib produced by the harfbuzz team, and g-golf to access and use it - you should try [and that may raise some bug(s), i'll fix them, but thinking your manual binding wil let you do something that isn't possible using introspection is a
<daviid>misunderstanding, i think
<daviid>going afk - bbl
<chrislck>sneek: botsnack
<ArneBab>cow_2001: yes — I need to write more on the text game, but I get sidetracked by stuff like fixing security ploblems in Freenet/Hyphanet or preparing lectures, not to forget work or family :-) (⇒ will take a while to get finished — I guess I’ll need to add some way how people can get updates)
<cow_2001>ArneBab: never heard of hyphanet
<cow_2001>oh boy. freenet... oh boy. do you remember Content of Evil?
<cow_2001>20 years ago it was a very weird blog on freenet
<ArneBab>cow_2001: yes, I remember … Hyphanet is what Freenet will be called in the future because the original founder decided unilaterally to claim the name for his new toy.
<ArneBab>(claim the name Freenet)
<cow_2001>so freenet is now something else?
<ArneBab>yes, weird :-(
<cow_2001>how hard is it to think of a new name ~_~
<ArneBab>I don’t want to speculate on reasons in public — I’m release manager of the original Freenet, but the founder controls parts of the infrastructure.
<cow_2001>"content of evil" is not even in search engines :(
<ArneBab>cow_2001: I’ve been working hard at damage minimization for the past months …
<ArneBab>(but this is kind of far OT)
<cow_2001>yeah, alright
<ArneBab>(except for: I actually wrote Guile tools to work with Freenet :-) )
<cow_2001>ah, that's on topic!
<ArneBab>message parsing, state handling, and fibers
<ArneBab>… content of evil actually still loads …
<cow_2001>content of evil is still there?! O_O
<cow_2001>it had this punk attitude
<ArneBab>last update 2006 …
<cow_2001>oh boy.
<cow_2001>was it written by gott? i forgot.
<ArneBab>I don’t see a name there
<ArneBab>cow_2001: for the tooling I wrote messages and processors (that can take out messages from a stream), but I had lots of headaches with atomic-box, because it caused crashes in some setups I thougt natural.
<ArneBab>cow_2001: and I have to take back one: it doesn’t yet use fibers.
<mwette>sneek: later tell abcdw, as an option, take a look at
<wklew>daviid: it was more that I didn't want to depend on gnome. but that indeed sounds much more reasonable as a place to start.
<abcdw>wklew: thank you! Yep, I already figured out about list of types for struct fields. But IIUC this list can contain only basic types, what if one of the fields is another struct? Like this:
<sneek>Welcome back abcdw, you have 1 message!
<sneek>abcdw, mwette says: as an option, take a look at
<abcdw>I also found that there is some lib, which allows to define field/type pairs for structs with bs:struct and it seems it supports the use case with other structures as field types.
<abcdw>mwette: Thank you! yes, this article has bs:struct from as well.
<abcdw>Is scheme-bytestructures is recommended approach to deal with nested structures? or it somehow can be handled with bare bone guile ffi?
<mwette>abcdw: old, lurking here was working on something
<mwette>abcdw: how many structures and functions are involved?
<mwette>Anyone ever chat on oftc? My attempts to connect almost always fail.
<Keele>mwette: yes. the kernel channels I follow are on OFTC.
<mwette>is tls required? are your connects reliable?
<Keele>I use TLS with self-signed cert. I think I have about one disconnect/reconnect per month.
<mwette>Keele: thanks so much
<daviid>wklew: yoy'd depend on g-golf dependencies, and wrt 'GNOME', that means only GLib, GOject and GObjectIntrospection, then the harfbuzz typelib of course
<daviid>mwette: note that all gnome channels moved to, fwiw
<daviid>quite recently
<daviid>if that matters :)
<mwette>daviid: thanks, I want #wayland, which on libera list says moved to oftc
<mwette>Keele: Does one need to register or anything? When I try to connect, emacs messages shows it tried tls, then not, and immediately shows "(ERC: CLOSED)" in the modeline.
<daviid>mwette: do you try M-x erc-tls then answer the questions ...
<daviid>just tried #wayland on libera, still there it seems
<daviid>ah ok.. nvm
<daviid>mwette: so i just connected to, it works fine here
<daviid>i am registered there, but daviiid, daviid was 'taken' alreadt
<daviid>mwette: i use oftc to talk to the #debian-next (testing) folks ... it never failed, so far
<mwette>daviid: thanks
<mwette>I got it now. I had an error in the hostname.
<daviid>mwette: great