IRC channel logs

2020-03-09.log

back to list of logs

<daviid>str1ngs: hey! as usual, can you provide a snipset or minimal script I can run here to reproduce?
<daviid>str1ngs: I changed the open.scm script example so it uses a thread within which I call g-application-run, and the main procedure returns app (the variable), soI can call gtk-application-get-activ-window and so I can reproduce ...
<daviid>str1ngs: however, I'd like to enhance this example so it effectively launch the app, which it doesn't ... I'm used to the gtk2/show-all/gtk-main way of 'doing things' ... could you do that for me? So users do not have to launch twice the app in a temrinal ... a complete 'heresy', to me :)
<daviid>str1ngs: ok, I foxed this bug, good catch, tanks - will review my fix and push asap, will let you know
<dadinn>hi all
<dadinn>i am looking at this manual page: https://www.gnu.org/software/guile/manual/html_node/Miscellaneous-String-Operations.html
<dadinn>at the end it says that string-replace-substring is a function defined in (ice-9 string-fun)
<dadinn>I am getting the error that it is not available
<dadinn>I mean this function is not defined or exported in that module
<RhodiumToad>in what version of guile?
<sirgazil>daddin: That is Guile 3.x manual I think.
<dadinn>ah, I am using version 2.0.13
<sirgazil>daddin: You can find the manuals for older versions in https://www.gnu.org/software/guile/learn/
<dadinn>Debian Stretch
<sirgazil>daddin: You can use GNU Guix to get newer versions of Guile and its libraries.
<dadinn>sirgazil: yeah, actually Guix is something which I am really interested in
<dadinn>sirgazil: just another reason to bite the bullet
<sirgazil>:)
<daviid>str1ngs: I a series of parches, the last being a fix to the gtk-application-get-active-window bug you reported above
<daviid>*I pushed a series of patches ...
<str1ngs>daviid: great will check this out.
<str1ngs>daviid: for this test case 'open is not required it could be tested in 'activate simply by not using a GtkApplicationWindow and calling (gtk-application-get-active-window app) from withing 'activate. I would not advise using threads etc for this either, if you do I would defiantly not reuse app more then once. It might work but I would question the sanity of that IMHO.
<str1ngs>daviid: does the gtk-application-get-active-window fix handle other functions and methods that might return NULL as well. I can't help but think 'gtk-application-get-active-window was not the only function effected by this?
<civodul>Hello Guilers!
<daviid>str1ngs: the fix should fix any procedure that return an 'object, not just gtk-applicaton-get-active-window
<daviid>any procedure that return or has 'out argument(s) that are of 'object type
<daviid>all those should now either return #f or an goops instance
<wingo>civodul: nice work on the releases!
<civodul>wingo: thanks! i felt it was needed
<civodul>but...
<civodul>it didn't quite meet my expectations in terms of bug solving :-)
<civodul> https://issues.guix.gnu.org/issue/39988
<civodul>so i'm head-down on weak tables again
<wingo>yarr
<wingo>civodul: hey
<wingo>have you heard the good news
<wingo>rr-project.org
<wingo>it is *amazing*
<wingo>i am now an follower of the church of rr
<wingo>*a
<civodul>oh!
<civodul>looks like it could be very helpful in this kind of situation
<wingo>yes
<wingo>you just run "rr record guile argument..."
<civodul>it produces a trace in the same format as gdb's reverse-debugging support, right?
<wingo>then "rr replay" puts you into a gdb
<civodul>crazy stuff
<wingo>where you can "cont" to the end of the program, set hardware watchpoints and then do "reverse-cont", etc
<wingo>reverse-next, reverse-finish
<wingo>it is great
<civodul>awesome
<wingo>i think it runs a local server and has gdb access it over a socket or something
<civodul>ok
<wingo>anyway, it is amazing and i fixed a couple guile bugs with it i think
<wingo>i hesitated before starting because i am a stick in the mud who does not learn new tools ;) but i should have started with it much earlier
<wingo>it's verry easy and incredibly effective
<wingo>the bug i found and fixed was the fibers one (cc30168878972652ddde4489351b76dc53f20142)
<wingo>having reverse-stepi was amazing
*civodul goes make a package
<jonsger>civodul: thanks for 2.2.7 and 3.0.1 release!
<dsmith>wingo: Are the recorded files huge?
<wingo>dsmith: no not really. all rr has to do is record syscalls -- the program runs deterministically between syscalls
<wingo>it also makes it so that multiple threads run on the same core, and records their switches
<dsmith>Hmm. Interesting. I wonder if it can be saved off-host (as in an embedded system with a ro rootfs).
<dsmith>Ah, depends on x86
<gagbo>I have a design question. I'm coming from oop languages and I wonder if I should use a class to encapsulate state with my functions.
<rekado_>gagbo: that’s a matter of taste. You don’t *have* to do that. You can use closures if you want to keep state associated with procedures.
<gagbo>Oh, no Shift-enter. Sorry. Question : I want callbacks to modify an "instance attribute" (i.e. a "view_id" in my case) which is a string that I want linked to a ncurses window
<gagbo>Ok, so 2 solutions are : make a class with goops, or craft it manually with the methods used in SICP ? I don't know if SICP code is simple just for educational purposes but hard to maintain in big source files later ; or if it's really the way people use it
<rekado_>I don’t understand your use case and I have no experience with ncurses
<rekado_>but here’s an example of a procedure with internal state:
<rekado_>(define (make-counter) (let ((count 0)) (lambda () (set! count (1+ count)) count)))
<rekado_>(make-counter) returns a procedure that has an internal count value.
<rekado_>Whenever you call it, the count will be increased.
<gagbo>fair enough.
<rekado_>for more complex state you can use complex values (such as records); or you could reveal internal state dependent on a procedure argument.
<rekado_>but if you’re doing this a lot, you might benefit from using GOOPS.
<rekado_>for just a bit of state here and there I think GOOPS is a bit too much.
<gagbo>One day paste.centos.org will respond and I'll paste some code just for the record. I think I'll start with the simple approach and see if I need more machinery then. Thanks
<gagbo> https://paste.centos.org/view/142efbf6
<rekado_>gagbo: would it make sense to have a record for buffers and simply use accessor procedures to get the fields of a <buffer> value?
<gagbo>I think it would yeah. But the <buffer> type would still need to be the return value or this make-buffer procedure now that I think about it (visible lines, current selection, active colorscheme are part <buffer>-local state)
<rekado_>gagbo: that’s not a problem, is it? Your make-buffer procedure can assemble the record value and return it.
<RhodiumToad>speaking of goops, is there a good way to do singleton objects?
<dsmith>civodul: /topic
*civodul ChanServ op #guile civodul
<civodul>no
<civodul>hmm
***ChanServ sets mode: +o civodul
<civodul>yay
***civodul changes topic to 'Welcome to #guile. See https://gnu.org/s/guile for more information. Guile 3.0.1 is out! <https://gnu.org/s/guile/news/gnu-guile-301-released.html>. This channel is logged, see <http://logs.guix.gnu.org/guile/>. Bug database at <https://bugs.gnu.org/guile>.'
<dsmith>civodul: tack
<civodul>thanks for the heads-up, dsmith!
<gagbo>rekado_: not a problem indeed, I'll do this I think
<civodul>rr is just incredible
<civodul>wingo: in struct.c:142, something's wrong
<civodul>there's a mismatch between the arg to scm_gc_malloc_pointerless and that to memset
<civodul>looks like the 2nd one is correct
<civodul>gcc could have told us, bah
*janneke finds that some native hurd build "fixes" broke earlier cross-build-to-hurd "fixes"
<janneke>the good thing about cross builds is that they offload very well
<janneke>oops that was meant for #guix
<dsmith-work>Monday Greetings, Guilers
<janneke>hello dsmith-work
***jao is now known as Guest75178
<civodul>gcc doesn't emit a warning for: memset(malloc(123), 0, 1234)
<civodul>sadness
<janneke>oh my...
<dftxbs3e>hah!
*dftxbs3e goes to look up what is 3.0.1 about.
<dftxbs3e>cool!
<oni-on-ion>'.sld' ? hmmm
<dsmith-work>civodul: Too bad that struct alloc size fix didn't make it into 3.0.1
<civodul>dsmith-work: yes, but OTOH, there'll always be a 3.0.(N+1) with more bugs fixed
<civodul>i'm so happy i was able to find it this quickly
<civodul>it really made my day
<civodul>it's the kind of thing that can keep you busy for ages, without rr
<dsmith-work>Yes, that's very impressive
<dsmith-work>Reminds me of the "time traveling debugger" in Elm.
<dftxbs3e>I met a heap corruption abort error the other day but couldnt capture any useful debug information :-/
<dftxbs3e>while running GNU Guix
<dftxbs3e>Has GNU Guile ever been fuzzed?
<civodul>probably not
<hugo>7,99dftxbs3e99,99: how do you mean fuzzed?
<RhodiumToad>fuzzing is the process of generating random input to a program and seeing if it crashes or otherwise misbehaves, it's a common technique now
<RhodiumToad>exposes all sorts of weird bugs
<dftxbs3e>hugo, software such as this does it: http://lcamtuf.coredump.cx/afl/
<dftxbs3e>It would be vital to fuzz GNU Guile, I'll have a look if I can..
<dftxbs3e>One can do coverage guided fuzzing, adjusting generated input to maximize the amount of code that gets executed in response to the input. Also to avoid testing with input that doesnt discover new zones of code.
<ryanprior>The Haunt site generator looks like it was last updated in 2015. Anybody still using & enjoying it?
<rekado_>ryanprior: I’m using it. Haven’t published anything new in years, though.
<janneke>ryanprior: i'm using it and so is guix; haunt could do with some of the custom extensions from the guix website, imho
<str1ngs>hello daviid 'gtk-application-get-active-window is now working. However there seems to be a regression with 'open arguments again. using this example case http://paste.debian.net/1134171 an running with ./open.scm ./foo .bar . 'open does not seem to be called and it now hangs. note, we can simplify this test case simply by calling ./open.scm with arguments it does not require an default application to be running. in other words no need
<str1ngs>for threads or running open.scm twice.
<str1ngs>daviid: my intuition tells me that it's probably trying to parse a NULL termination that does not exist. maybe 2e32c99b5379eafc2d95b5f9789522243c9f073f needs some more tweaking?
<enderby>Hi, wondering if there's a library for CSS like there is for HTML (with SXML)?
<enderby>i thought i saw one somewhere once
<dsmith-work>sneek: software-list?
<dsmith-work>sneek: software?
<dsmith-work>sneek: guile-software?
<sneek>guile-software is http://sph.mn/foreign/guile-software.html
<dsmith-work>enderby: http://www.nongnu.org/scss/ perhaps
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>enderby: Check out the above guile-software link
<enderby>dsmith-work: ya! ty