IRC channel logs

2019-09-17.log

back to list of logs

<daviid>spk121: it appears I didn't take note on how to run gdb, could you post these steps for me again? sorry I didn't took noe at that time ...
<daviid>spk121: here is a snipset that segfault g-golf - http://paste.debian.net/1101138/
<spk121>daviid: could it be that you've failed to call gtk-init or gtk-init-check?
<daviid>spk121: it could, but you don't either in your borwser example?
<daviid>spk121: inieed, that solved the problem, but then why does it work in guile-gi?
<daviid>though i now have this warning (guile:14282): Gtk-CRITICAL **: 21:04:07.884: New application windows must be added after the GApplication::startup signal has been emitted.
<spk121>daviid: yeah, the order of operations in the guile-gi example is slightly different: 1. make the application, 2. run the application, 3. attach the window, 4 show the window
<daviid>spk121: but where do you call gtk-init?
<daviid>spk121: i just 'changed' the 'order' because i don't have signals in g-golf yet ...
<spk121>"Concretely, gtk_init() is called in the default handler for the “startup” signal. Therefore, GtkApplication subclasses should chain up in their “startup” handler before using any GTK+ API." Basically it gets call in application_run
<spk121>Or at least that's how I understand it.
<daviid>the default start-up signals should be triggered in g-golf to (?)
<spk121>not sure. Maybe start with g_application_new then call g_application_activate instead of gtk_application_new
<spk121>Or maybe "startup" is g_application_register
<daviid>spk121: here is soething that 'kind of' work: it starts the app, and loads the uri, then lock itself (i need kill-9 my guile ...) - http://paste.debian.net/1101146/
<daviid>ah maybe a gtk-main as weel
<daviid>but i thought that was what g-application-run was doing ...
<daviid>spk121: i don't understand your suggestion, because it mixes gio and gtk, i have zero knowledge on how to make these colaborate, please help me by changing the code (last pasted) - if/when you have time of course ...
<spk121>daviid: a GtkApplication is a subclass of a GApplication, so you should be able to cast between them
<daviid>i also have zero knowledge about these new gtk-application* classes, methods ... i'm still 'stuck' in gtk2, which was a million time, at least, easier ...
<daviid>ah!!! then i reach a problem i know i have to address ever since i started to work on g-golf, and that is it import classes in a 'flat way' - which i know, of course, is insufficient, but i needed to bootstrap things, and so far so good, i'm very pleased with what g-golf has, though this class tree i a fundamental todo item, so is signals, gclosures ...
<daviid>spk121: but would it be possible to make the above paste work in the current g-golf 'state of things'?
<spk121>daviid: the above paste works for me, but, it won't kill until you can connect the destroy signal.
<daviid>that's fie, but here it locks
<daviid>for example, no uri in the page is active
<daviid>reactive, i can't click those for example
<daviid>oh, this time it did ... sorry
<daviid>ah no, it locks if the mouse goes out then in the app win again - this is not expected either, since it shoud at least ru all gtk default signals
<spk121>for me it tries to load a page, then dies. but I get "Warning: Unimplemented type - array;: (c -1 #f 0 utf8)" and the "New application windows must be added after GApplication::startup"
<daviid>the first warnig you may ignore, the second i don't know why neither how to solve this, do you?
<daviid>i mean it's not a g-golf problem, but a sequence of gio/gtk call problem, imo
<spk121>daviid: I don't really want to try to figure out how to do GObject w/o signals. It is pretty fundamental to how it is supposed to work. Maybe you can get it up and running by doing things more GTK2-like, but, I really don't know
<str1ngs>daviid: you need to use a signal. I have not seen it any other way
<str1ngs>g_application_run takes a GApplication which GtkApplication inherits
<str1ngs>daviid: https://wiki.gnome.org/HowDoI/GtkApplication for reference.
<str1ngs>typically the first window is created within activation.
<daviid>spk121: it's not that i don't want to implement signals :), it is that it shuld not, imo, influence this lock problem i face, there is no reason why the default signal callback would/should not work
<daviid>but anyway, tx
***jao is now known as Guest24661
<str1ngs>daviid : application_run blocks
<str1ngs>err g-application-run I should say
***jao- is now known as jao
<daviid>spk121: sorry, i stand corrected - the warning, in the case of g-/gtk-applic* indeed says "New application windows must be added after the GApplication::startup signal has been emitted."
<daviid>I just wanted to have a gtk/webkit tiny example to offer ... it'll have to wait signals then
<str1ngs>daviid: I can create a tiny webkit example. it just wont' use gtk-application and it won't handle the shutdown signal. so when you close the window the program will not stop
<str1ngs>I was under the impression though you wanted to use <gtk-application>
<daviid>str1ngs: please do, we'll add those as examples for g-golf users
<str1ngs>I made this yeserday for a user http://paste.debian.net/1101158 . but instead of using a label I'll use a webview sound good?
<str1ngs>daviid ^
<str1ngs>also I sould expand the imports? I didn't quite understand that yesterday.
<str1ngs>should*
<daviid>str1ngs: i didn't want to use gtkapp, i was 'just' copying, to learn about g-/gtk-applic*, the guile-gi exmple, and it still is a total surprise to me, that it won't work without signals - to me, this is a fundamental design mistake
<daviid>i mean it should always, work with default signakl callback 'only', user signal calçbacks should never be imposed, imo
<daviid>but let's not discuss this, it would be a waste of time ...
<str1ngs>daviid: that's understandable. the thing with gtk-application is it's use for more complete programs. It's for cases where your program need uniqueness and you might want to handle opening files.
<daviid>tx for the paste, is this the 'standard' gtk(3)+ hello world example as in C? curious
<str1ngs>it provides RPC for signals as well in that a new program instance will call something on the default instance.
<str1ngs>daviid: I would say this is the most simple use case. but if you were to talk to a GTK+ developer then would probably advocate GtkApplication
<str1ngs>they would*
<str1ngs>the stand GTK examples all use GtkApplication. see https://github.com/GNOME/gtk/blob/master/examples/hello-world.c and it's parent directory
<str1ngs>standard*
<str1ngs>daviid: I will extend this hello world to use a webview and link the paste. It's still a nice example IMHO.
<daviid>ok tx
<str1ngs>later when g-golf supports signals, we can add the shutdown signal for completeness. it will make for a simple example
<daviid>sure
<str1ngs>actually for this to work we connect to the windows destroy event and then call gtk-main-quit to end the main loop.
<str1ngs>Also we could maybe have our on mainloop but that complicates the example what do you think?
<str1ngs>our own*
<daviid>str1ngs: do as you wish, i really just wanted to see this beowser in g-golf, later, we'll have signals of course, i hope soon now
<str1ngs>daviid: I added a comment that should help
<daviid>it's a bootstrap problem, i need to fix/complete the missing bits one per one ...
<str1ngs>no worries I understand.
<str1ngs>and unfortunately the #:uri is not writable. so I'll just use the method
<daviid>what do you mean 'the #:uri is not writable'? is this another g-golf missing bit?
<str1ngs>daviid: http://paste.debian.net/1101164
<daviid>ok tx
<str1ngs>daviid: no that's a webkit thing it's all good. you can only use the method. the #:uri property is read only I guess. ie (make <webkit-web-view #:uri "https://www.gnu.org">) would be handy
<str1ngs>daviid: hopefully my example helps
<daviid>str1ngs: yes, uri is a read only property, this is a webitk 'proble, ot a g-golf problem ...
<str1ngs>right
<str1ngs>daviid: also you pasted a eval when example yesterday that I did'nt grok completely
<str1ngs>does that help with handling when import occures?
<daviid>str1ngs: it is indispensable to create modules - so far, you wrote examples that you load ... but the recommend way is to write modules: in order for the module to compile without (rightfully) raising warnings, bindings must be available at compile time, hence the eval-when form
<daviid>modules will help you to structure your code/app as you probably know ... just look at g-golf :) - without modules, it would be unmanageable
<daviid>str1ngs: http://paste.debian.net/1101167/ - though it could import 'less then the all gtk namespace'
<str1ngs>daviid: makes more sense thank you. There are places where I think I should be using eval-when then. I will try to read up on this more
<daviid>str1ngs: just comment the eval-when in the above paste, you'll get a better idea of what i'm refering to
<lispmacs>is tms:clock, etc., returning values in nanoseconds?
<str1ngs>davidl: so eval-when ensures gi-import is only called during run time?
<lispmacs>that is what it looks like when I try (tms:clock (times)), but was wondering if that was a platform specific thing, or...
<daviid>str1ngs: no, the opposite, it ensures the forms it contains will be excuted at expand load eval time, as you can read
<str1ngs>daviid: I'm reading https://www.gnu.org/software/guile/manual/html_node/Eval-When.html and trying to understand. I guess I'm wonder the importance of this in regards to gi-import. Thanks for your patients. My scheme/lisps skills are still quite weak
<daviid>str1ngs: it is dead important :)
<lispmacs>must just be the times() system function
<daviid>str1ngs: as i said, just comment and compile the module again ... it should help you to understabd
<daviid>i mean comment the eval-when form, and copy paste its content as top-level module calls, then save and compile ....
<str1ngs>daviid: I will test your REPL example thank you.
<daviid>np!
<str1ngs>daviid: so far from my understanding using eval-when resolves unbound variables like warnings gtk-container-add still not grokking it completely but it's making more sense. I'm definitely going to start using this with nomad once I have a more complete understanding thanks for mentioning this.
<daviid>spk121: i was thinking about your desire for immutable bytevectors, the kernel 'immutable mem pages' ... maybe there is wwell designed, well maintained C lib 'out there' that povide the functionality you need, which the dynamic ffi would llow to bring to guile at relatively 'low cost'
<lloda>how is the alias (srfi :x) for (srfi srfi-x) implemented?
<civodul>Hello Guilers!
<weinholt>lloda, i think it's module/ice-9/r6rs-libraries.scm
<weinholt>hello civodul
<lloda>ooh thx weinholt
<lloda>looks tricky
<lloda>oh I was looking into this b/c (import (srfi :4 gnu)) used not to work
<lloda>but it does now
<lloda>was it changed recently?
<lloda>otoh you cannot do (@ (srfi :1) fold) for example
<lloda>actually, I'm not sure (import (srfi :9 gnu)) is working properly
<lloda>see https://paste.debian.net/1101181/
<lloda>??
<lloda>import gives no error, but it doesn't import
<weinholt>lloda, (srfi :9 gnu) becomes just (srfi srfi-9), try (import (srfi :9 happy gnu)) or just (import (srfi srfi-9 gnu))
<lloda>weinholt: that's not how it should be, right?
<lloda>e.g. the comment in r6rs-libraries says
<lloda>;; (srfi :n ...) -> (srfi srfi-n ...)
<weinholt> ;; SRFI 97 says that the first identifier after the colon-n
<weinholt> ;; is used for the libraries name, so it must be ignored.
<weinholt>r6rs code will usually import e.g. (srfi :1 lists), but guile doesn't define a module with "lists" in its name, instead it just removes that part. in other r6rs implementations there are usually both (srfi :1) and (srfi :1 lists) as separate files, but guile's way also works
<weinholt>of course it becomes a little weird when there are other modules under the srfi namespace, but that's how it is :)
<lloda>well thx for the explanation weinholt
<lloda>:-\
<lloda>I'll just avoid the :nn thing
***spk121_ is now known as spk121
<nly>why does sxml->xml does not have #:namespaces argument?
<sneek>Welcome back nly, you have 1 message.
<sneek>nly, rekado says: There’s an old discussion re XML namespace handling that might be of interest to you: https://issues.guix.gnu.org/issue/20339
<nly>sneek: tell later rekado thanks!
<sneek>later, nly says: rekado thanks!
<nly>sneek: tell rekado thanks!
<sneek>rekado, nly says: thanks!
<nly>sneek: later tell rekado thanks!
<sneek>Got it.
<nly>sneek: botsnack
<sneek>:)
<dsmith-work>Tuesday Greetings, Guilers
*jcowan wishes there were a way to tell various allocators to use named shared memory
<jcowan>I don't even care about mutability, I just want to prevent the same heavyweight data from having to be kept in a whole bunch of processes
<heisenberg-25>Hi, where I can find the documentation for the module (scheme documentation) ? :)
***paroneayea is now known as dustyweb
<Sheilong>Do I need to import something in order to use list selectors?
<dsmith-work>Sheilong: Not sure what you mean.
<dsmith-work>Sheilong: Like c{a,d}r and friends? No.
<Sheilong>I"ve had to import (use-modules (srfi srfi-1)) to use drop and take selectors
<dsmith-work>Ah yes.
<dsmith-work>Ok, lets see if this works:
<dsmith-work>sneek: guile help drop
<dsmith-work>It did. but by /msg
<Sheilong>sneek: guile help drop
<davidl>does anyone have a link to some example code for SXPath selector statements? Im having trouble understanding the manual and need some predicate type xml selections, that would be expressed like: //div[@class=’ col-sm-12 google-sign-form’]/child::input[1] in "regular" XPath.
<rekado>davidl: guile-debbugs uses sxpath quite a bit, but still it’s nothing as complicated as what you’ve shown.
<davidl>rekado: ok thanks Ill check that one out
<dsmith-work>davidl: Does this help? https://docs.racket-lang.org/sxml/sxpath.html
<davidl>dsmith-work: thx, I think that helps too. I found also in the test-suite in this okmij.org/ftp/Scheme/lib/SXPath.scm there are some sxpath selections similar to whats covered in the guile manual, e.g. using select-kids and node-equal? corresponding to a search like /descendant::any()[child::text() == "third para"]
<dsmith-work>davidl: It would be nice to have something that takes an xpath string and spits out the equivalent sxpath.
<davidl>dsmith-work it sure would