IRC channel logs

2020-08-11.log

back to list of logs

<lfam>I know that Guile 3.0.3 increased compiler speed at certain optimization levels. I'm wondering if there have been any recent reductions in space / memory usage?
***catonano_ is now known as catonano
<tramplefoot>since guile has no support for srfi-20, it would be safe to assume that goops is 100% srfi-20 compatible?
<tramplefoot>would it be** oops
<daviid>str1ngs: fwiw, i wrote and pushed the (g-golf gi utils) doc, all procedures
<daviid>str1ngs: wrt glist/gslist, g-golf has gi-glist->scm, gi-gslist->scm and scm->gi-gslist (so currently it's missing scm->gi-list, but as i said earlier, ping me if/when you need it ...)
<daviid>wrt glist/gslist, g-golf currently only manages pointers (none of the 'portably storing integers in pointer variables') - if you need those, let me know
<str1ngs>daviid: okay thinks, will read about those when I have time. Right now I don't have a need for those. Only thing I might need that is not support by g-golf yet is webkit_web_context_register_uri_scheme. I'm still researching that though. could be I'm not using right.
<str1ngs>thanks*
<daviid>str1ngs: you mean becasue g-golf misses calbacks right?
<daviid>wrt webkit_web_context_register_uri_scheme
<str1ngs>I get this ** (browser.scm:383439): CRITICAL **: 19:38:52.222: void webkit_web_context_register_uri_scheme(WebKitWebContext*, const char*, WebKitURISchemeRequestCallback, gpointer, GDestroyNotify): assertion 'callback' failed
<str1ngs>not sure if it's the callback or the GDestroyNotify . my guess it's the GDestroyNotficy despite it saying callback. maybe you know off hand? if not I'll just research it more.
<daviid>str1ngs: just like for the other callback you tried - the vte-terminal example - unless the callback can be NULL, it won't work in g-golf, till g-golf has a full callback implementation (which is not exactly a piece of cake to implement, but on the todo list, after GIInterface ...)
<daviid>i was writing the above before to read your last sentence :) - i don't know
<str1ngs>daviid: okay that makes sense. I think though the is the destruct callback though right? I just want to make sure I understand the limitation to work around it properply.
<daviid>str1ngs: i don't understand that sentence
<daviid>str1ngs: i think, from the error paste above, that it is because of the callback, not because of the GDestroyNotify - i think for the time being, for that call in particular, you'll have to cook something in C ...
***terpri__ is now known as terpri
<str1ngs>daviid: okay, that's good to know. I wasn't expecting that I thought it was GDestroyNotify that was not supported. I'll work something out in C meantime. This would eventually supported by g-golf though? Not a rush I'm just curious.
<daviid>str1ngs: yes, i hope to support callbacks, and prob will need help, because it needs a C marshaller ... it's unfortunate the gnome team didn't simply reuse the GClosure functionality for callbacks, i don't know why, but that's howit is ...
<str1ngs>daviid: aww I recall this now. I actually had this mapped out in my head how to do this. now I forgot I should have made notes :0
<str1ngs>:(
<daviid>str1ngs: i have taken deep notes of related conversations, #introspection - when the time comes, it's just to read and implement :):)
<str1ngs>I'm glad someone is organized :) When the time comes let me know if you need any help.
<daviid>str1ngs: but don't do anything before i ping you - i really wana set-up things first
<daviid>yes, will do ... tx
<str1ngs>no worries, It's nice because I have so much to do with Nomad. So report issues I find. Which is very few. g-golf has come along way over this last year.
<daviid>the doc is uploded, fwiw, here - https://www.gnu.org/software/g-golf/manual/html_node/Utilities.html#Utilities
<str1ngs>will read this now.
<daviid>str1ngs: then could you proof read the sentences that start as 'The GType of value is (must be) a ...' and make sure the GTYpe mentioned is correct ...
<str1ngs>gi->scm and scm->gi look very useful.
<str1ngs>daviid: which procedure or syntax is that under?
<str1ngs>The GType of value...
<daviid>str1ngs: yes - i thougyht you might wana use those - feel free to snarf outside g-golf ..
<daviid>str1ngs: all gi-*->scm proc have such a sentence
<str1ngs>ah just use. The GType of value must be a gchar* or a gpointer, respectively.
<daviid>yes, -lease check that it is correct
<str1ngs>see my suggestion.
<str1ngs>I would leave out respectively too not needed.
<daviid>would you? thought i'm more concern about the C correctness of the sentences, i lso wanted to use 'respectively' and find it a little 'too much' :):)
<daviid>*/thought/although
<daviid>you think respectively is too much then
<daviid>no need for it? i'm not a native speaker ...
<str1ngs>in this case it's somewhat implied that each must be either a gchar* or a gpointer. it's not wrong just not required.
<daviid>ok
<str1ngs>also for gi-boolean->scm. change maybe to The GType of @var{value} must be a gboolean.
<str1ngs>some please you use @var some you don't just a FYI
<str1ngs>actually you have @var sorry disregard that. just change to The GType of value must be a gboolean
<daviid>you mean remove 'is (must be) and say must be ...
<str1ngs>right
<daviid>ok, i also hesitated about this ...
<daviid>str1ngs: tx - doc changes pushed, online doc updated as well
<str1ngs>daviid: looks good too me.
<str1ngs>daviid: I'm adding URI scheme support for Nomad I want to handle things like gnunet:// and nomad://manual/welecome. in the case of nomad I want to use sxml to present rich documentation.
<str1ngs>nomad:// will be a restful API to serve sxml docuements.
<daviid>str1ngs: great- and about:* ...
<str1ngs>daviid: yes it will look more like this nomad:///about/
<str1ngs>or maybe nomad://sxml/about? sxml technically the host name so not sure what to use there /// is also valid but confusing to read.
<str1ngs>the restful part is nice since you can do this nomad:///tutorial/buffers
<str1ngs>plus links will work you get the idea.
<daviid>str1ngs: i'm really not knowledgeable to any of this, but i would (at least also try to) support what users do know 'already', for these std URI's, like about: ...
<daviid>thenyou should find a good 'maxime' for about:nomad :)
<daviid>did you know this one? about:epiphany (in epihany/gnome web)
<str1ngs>yes, though this will be more extensive this just an about. I can though just redirect about about:
<str1ngs>in the case of ipfs:// for this far exceeds what about: does
<str1ngs>for example*
<peanutbutterandc>Hey there
<peanutbutterandc>I was wondering if there was some sort of de-facto testing module for guile...
<peanutbutterandc>I can see that the source repo contains .test files but it does not appear that there is anything like that for normal user usage (?)
<str1ngs>hello, there is (srfi srfi-64) and also (unit-test) from guile-library
<str1ngs>peanutbutterandc: ^
<peanutbutterandc>str1ngs, Hey there! Could you please give me some relavent docs to read please? URLs, other pointers?
<peanutbutterandc>(use-modules (unit-test)) doesn't work...
<peanutbutterandc>Okay srfi-64 one does
<str1ngs>well depends which one you want to use.
<peanutbutterandc>str1ngs, I am a beginner
<str1ngs>(unit-test) requires guile-library
<str1ngs>peanutbutterandc: if you are new to guile I would use srfi-64
<str1ngs> https://srfi.schemers.org/srfi-64/srfi-64.html
<str1ngs>it's pretty straight forward.
<peanutbutterandc>str1ngs, guix show guile-library does not return anything. Am I missing something?
<str1ngs>in guix it's called guil-lib
<str1ngs>err guile-lib
<str1ngs>here's the docs for (unit-test) https://srfi.schemers.org/srfi-64/srfi-64.html
<str1ngs>err sorry wrong link. http://www.non-gnu.org/guile-lib/doc/ref/unit-test/
<peanutbutterandc>str1ngs, I see... thank you. I have another question: I have heard that guild is supposed to grow into something resembling pip for guile later on....
<peanutbutterandc>is that true?
<peanutbutterandc>Or will guix do the job just so?
<peanutbutterandc>str1ngs, Thank you very much, BTW. :)
<str1ngs>you mean guildhall?
<peanutbutterandc>I suppose that
<str1ngs>guix probably super seeds guildhall :)
<str1ngs>though one day guix might have a subset just for managing guile libraries :)
<peanutbutterandc>str1ngs, I see. so just use guix. noted. Um... regarding (srfi-64) vs (unit-tests) which one do you use and why?
<str1ngs>I prefer (unit-test) since I can logically encapsulate tests into methods. also the tests don't run when I load the file. srfi-64 is just as good but for other use cases. (unit-test) requires some (oop goops) knowledge
<peanutbutterandc>str1ngs, I see. Thank you very much for helping me out.
<str1ngs>remember (oop goops) is not all that portable. so srfi-64 is better to use in that case. plus it a good place to start.
<peanutbutterandc>str1ngs, I see. Thank you very much. srfi-64 will be the one, then. :)
<str1ngs>no problem
<peanutbutterandc>Okay... another question: in the source tree, where can I find code for procedures in the module (guile)?
<leoprikler>a great number of places
<leoprikler>not quite sure if it's just the C source or it has some more
<peanutbutterandc>leoprikler, Hey there! Did manage to grep it and it turned out to be a .c file.... so yeah but looking into it
<RhodiumToad>stuff from places like ice-9/boot-9.scm and ice-9/psyntax.scm ends up in the (guile) module
<peanutbutterandc>RhodiumToad, Hey there! ... I see
<RhodiumToad>probably other things too, I don't know
***terpri_ is now known as terpri
<RhodiumToad>interesting, having been reading boot-9.scm out of curiosity since it came up above, I notice it uses (let-syntax) in quite a few places
<RhodiumToad>in a way that would break with the r7rs semantics of let-syntax
<dsmith-work>Tuesday Greetings, Guilers
<peanutbutterandc>Okay I have a question: does not the value of a variable set in the script over-ride the value from an imported module?
<peanutbutterandc>Because I just had the strangest experience (guile 3.0.2)
<peanutbutterandc>This thing did not write to a log file named "this-thing-here" https://termbin.com/urumk
<peanutbutterandc>line 203 in testing.scm (in (srfi srfi-64 srfi-64)) implies that
<peanutbutterandc>and so does the code later on
<peanutbutterandc>there's an if
<peanutbutterandc>s/(srfi srfi-64 srfi-64/(srfi srfi-64 testing.scm/
<peanutbutterandc>Can anybody give me any clue as to why this test does not print in stdout but prints to a log file (despite the explicitly set-to-#f test-log-to-file variable): https://termbin.com/um8r ?
<leoprikler>peanutbutterandc: The behaviour of SRFI-64 is to a pretty large extent controlled by your test runner.
<leoprikler>The default test runner (at least in Guile) appears to use (test-begin ...) to derive the log file name
<peanutbutterandc>leoprikler, But shouldn't guile respect my setting test-log-to-file? The code in $GUIX_PROFILE/share/guile/3.0/srfi/srfi-64/testing.scm does indicate that it should
<leoprikler>this is Scheme, not Emacs Lisp
<leoprikler>you can try some hackage to overwrite this definition, but I don't think that's the intended way of handling this
<peanutbutterandc>leoprikler, I am sorry but itsn't that a global variable definition? I know that scheme is lexically-scoped and elisp isn't (read about that in guile manual, I think) but I don't understand why it is affecting me here (I am a n00b)
<leoprikler>In short, as per the lexical scope of the test-log-to-file, the compiler can assume (and will for optimization), that this parameter is always #t.
<leoprikler>For this to work as intended in Guile test-log-to-file should be a parameter or (in accordance with other SRFIs) a box.
<peanutbutterandc>leoprikler, But it is in the global scope, is it not? And my (define )-ing it again (or (set! )-ing) it in this particular file should change it's value before compilation, should it not? I am really confused.
<leoprikler>also note: ;; Not part of the specification. FIXME
<leoprikler>Your local setting of the variable is local to your module.
<leoprikler>It does not affect the binding, that is present in the srfi-64 testing module, which is where you want the change to have an effect.
<dsmith-work>In guile 3, some module bindings can be optimized as constants. Or something like that. DOn'
<dsmith-work>t really have a handle on that yet.
<peanutbutterandc>leoprikler, what you said does kinda' make sense.... I have one final question (since I come from python). In python we do stuff like `import this_module` and then things like `this_module.this_particular_stuff = "something else"`.... I guess the reason with python I'm actually changing stuffs in the module's lexical scope then... right?
<leoprikler>Yes, and you can also do something similar in Guile.
<leoprikler>Have a look at module-set! and module-define for instance
<leoprikler>However, I would strongly advertise against doing something like that, as the definition may already have been inlined.
<peanutbutterandc>leoprikler, I did that, too, but to no avail. But maybe I am doing something wrong? Or perhaps it is because (srfi srfi-64) itself gets that value from (srfi srfi-64 testing)? Here: https://termbin.com/fftuj
<leoprikler>try it with srfi srfi-64 testing
<leoprikler>but I think it's the compiler
<peanutbutterandc>leoprikler, just did. Didn't work
<leoprikler>yep
<peanutbutterandc> https://termbin.com/m0rv
<peanutbutterandc>"it's the compiler" as in, a bug in guile? o.O
<leoprikler>so if you do want that thing to work as a parameter you have to write your own test runner
<leoprikler>no, it's a bug in srfi testing
<leoprikler>the compiler is allowed to optimize away this definition, so you setting the variable has no effect
<peanutbutterandc>leoprikler, *sigh* all I wanted was some simple tests. :( So, do I have to report this bug to srfi people?
<leoprikler>well, you did want a bit more than that in that you don't want them to log to a file ;)
<peanutbutterandc>leoprikler, logging to stdout looks a whole lot cooler
<peanutbutterandc>:P
<leoprikler>writing your own test runner should not be so difficult tho, especially for this case
<peanutbutterandc>leoprikler, I will have to read the srfi in it's entirety then. *sigh* more reading...
<peanutbutterandc>leoprikler, Anyways, thank you very much for your help
<peanutbutterandc>how do I report this to the srfi people? o.O
<chrislck>it's not difficult to log to stdout
<peanutbutterandc>chrislck, How do I do it?
<chrislck>use this custom test-runner: https://github.com/Gnucash/gnucash/blob/maint/bindings/guile/test/srfi64-extras.scm#L24
<chrislck>then (test-runner-factory gnc:test-runner) before your tests
<chrislck>why fight with srfi? use the tools it gives you
<peanutbutterandc>chrislck, lol that was so unexpected. I was thinking there was some clever hack/kludge that you were going to give me. But thank you anyways. I will use it to write a runner thingy (perhaps that will learn me some scheme)
<chrislck>in this snippet above, calling (test-end ...) when finishing your tests will have the advantage of returning #t if all tests pass
<peanutbutterandc>chrislck, I see. Since you have given a link to gnucash... I have another question. From what you know of gnucash, how extend-able is it? I want to extend it with guile (someday) to more-easily do multiple invoices in a single session (personal requirement). While I did write a python script to deal with the issue: https://github.com/peanutbutterandcrackers/gnucash_invoice_automator I need something... GUI-ey
<chrislck>Use python GUI stuff
<peanutbutterandc>chrislck, .... and I have this thought of making a spreadsheet-like thingy for gnucash and it'll sit somewhere in the menus and I could have my non-tech-savvy friends to use it...
<peanutbutterandc>python GUI?
<chrislck>PyQT PyGTK TkInter etc
<lloda>peanutbutterandc: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=2b4e45ca1b89a942200b7b9f46060dddc44d2876
<lloda>that issue with test-log-to-file was a bug
<peanutbutterandc>chrislck, will that thing be open-able from within gnucash itself? somehow? I was hoping the guile thing will sit in the menus and then come out like a spreadsheet....
<peanutbutterandc>lloda, Hmm.... let me try it with my local build then
<lloda>however i agree it's a dubious interface, to set globals like that. So it's better to use your own runner.
<chrislck>¯\_(ツ)_/¯ you'll need to ask the main devs how to hook python code and GUI to menus
*chrislck likes his custom runner
<peanutbutterandc>chrislck, could this not be done with guile (GUI thing)? I like guile better these days.
<chrislck>¯\_(ツ)_/¯ you'll need to ask the main devs how to hook guile code and GUI to menus <--
<peanutbutterandc>Understood. My previous experience with gnucash channel has been.... silence. And similar with the mailing list. Therefore my jumping at an opportunity here
<peanutbutterandc>lloda, I have some good news and some bad news. Good news is: with (module-define!...) no log file is written (in my build) the bad news is, nothing prints to stdout.
<peanutbutterandc>...which probably means the srfi thingy should be made to treat stdout as a port in the thingy where it takes the log-file and then write whatever to stdout
<peanutbutterandc>if that is how scheme works
<peanutbutterandc>i am just going through my introductory books
<peanutbutterandc>lloda, also, the thing only displays "# of expected passes n" on the screen. I wish it displayed a summary by default.
<lloda>without the patch module-define! isn't guaranteed to work. And with the patch, set! is enough.
<lloda>the default runner is very raw.
<lloda>looks like you want a custom runner!
<peanutbutterandc>lloda, strange. define didn't work and set! did!
<peanutbutterandc>lloda, also, please forgive me for saying this, but perhaps scheme hackers should not be like "the default thing is very raw, but whatever i'll just write a custom one", but rather give a very neat default ? Maybe this is me just being too pythonic. but sensible-defaults sound like a good idea....
<peanutbutterandc>lloda, could you please explain why set! worked and define didn't?
<lloda>set! sets the module variable, but define makes a new one local to the script, so the module doesn't see any change
<lloda>and fwiw I agree with you about defaults, but this is more a result of building things by sparse committee more than any Scheme philosophy
<lloda>srfis are improved by making new ones, not by changing old ones, b/c finding agreement between users is hard
<peanutbutterandc>lloda, I thought set! and define were basically the same thing (n00b here).... is there something I can read on, please?
<lloda>well you can have bindings with the same name in different modules
<lloda>these are different bindings ofc
<lloda>if you repeat defines inside the same module, that's a different thing
<peanutbutterandc>lloda, so... if I were to be a smart-bum straight-outta-python guy and send in a PR with what I think is a sensible-er default.... what would happen? o.O
<peanutbutterandc>lloda, Ah! That kinda' makes sense!
<lloda>peanutbutterandc: if the maintainers like your change, it might get included
<peanutbutterandc>lloda, Oh wow. That'd be quite the thing! :)
<lloda>it may need a lot of convincing and patience tho, or work that seems pointless to you but others ask of you to be convinced. So too often it's easier to patch things for oneself
<lloda>I'm not arguing that's a good thing, but I don't know how to fix it
<lloda>Schemers do tend to be free spirits and that has its good and bad sides
<peanutbutterandc>lloda, I see... I'm just a n00b, though. Starting htdp.org these days (because I am too afraid to approach sicp). Maybe I should just take care of my own small things then.
<peanutbutterandc>:)
<lloda>questions are good :-)
<lloda>sharing is good too.
<peanutbutterandc>lloda, Thank you for your help. Off I go now, then... to srfi 64 and runners and stuff... :)
<lloda>yw!
<chrislck>(web server) doesn't seem to have a clean way for the handler to tell the server to shutdown
<chrislck>the handler can call (exit) which is rather... explosive
***jonsger1 is now known as jonsger
<chrislck>if I want the handler to schedule a shutdown call and return a goodbye message, e.g. (shutdown-webserver-in-2-seconds) (build-response "Shutting down, goodbye"), it doesn't seem easily done
<ArneBab>lloda: for the SRFI you can normally just clone the repo and file a pull request for the reference implementation. I don’t expect them to dislike a more powerful default runner.
<rilez>Do you know of any implementations of common lisp--style restarts for guile?
<rilez>Built with prompts and exceptions I guess?
<dsmith-work>rilez: There was some very in-depth discussions about that on the mailing lists recently.
<dsmith-work>Like within the last 30 days or so.
<dsmith-work>(or so my memory tells me. Not the most reliable..)
<dsmith-work>But basically: No.
<dsmith-work>Not like CL anyway
<rilez>I'll check the logs!
<rilez>Is the search for the chat logs broken for anyone else?
<dsmith-work>rilez: Start from here https://lists.gnu.org/archive/html/guile-user/2020-08/msg00008.html
<dsmith-work>Yeah, seems the search is broke for the channel logs.
<rilez>How can I help with documentation?
<ArneBab>you can start by getting the Guile source (git repo) and looking into the handbook (doc/ref/*.texi)
<rilez>thanks!
<stis>Hi guilers!
<dsmith-work>Hej, stis How goes the python?
<stis>Well I got the unit testframework for Cpython n shape
<stis>plan run the tests to spot errors and make it more according to the standard
<stis>but hacking is low on summer as I spend time walking and visiting friends.
<dsmith-work>stis: I think it's quite amazing the work you are doing there.
<stis>thx
<dsmith-work>Python is *not* may favorite language. However I've had to use it quite a bit for about the last 5-6 years or so.
<stis>yeah we use it at work as well along java c++ c#
<stis>not a big fan either of it.
<stis>and now I'm som kind of expert on it lol
<dsmith-work>Heh.
<leoprikler>Don't you want to have multiple destructors tho?
<dsmith-work>It's not all bad. There worse things I'd rather not use. But I've been bitten serveral times by it.
<stis>sure it' sometimes neat, but being bitten by scheme the wrong design desitions shows
<stis>But with guiles python you can quickly leave python and enter the golden gates of scheme.
<stis>bitten is swinglish I think for beeing introduced and love it
<leoprikler>Biting is a thing you can do in pleasant and unpleasant ways.
<leoprikler>I think dsmith-work's experiences were unpleasant ones from the tone of it.
<stis>yeah I understand that, but mine was the pleasure version of it. Was not sure if it was a Sedish thing or more general.
<stis>leoprikler: what did you mean by multiple destructors?
<stis>guile is GC'ed and Python is referenced and therefore there is less need for destructors in guile python to break circlular references
<leoprikler>C++21 will apparently have a feature, wherein template classes can have more than one destructor depending on the template arguments (using contracts to ensure, that only one is instantiated per specialization).
<stis>cool
<leoprikler>Which means, that somewhere around 2027 we can start actually using this.
<stis>lol
<leoprikler>To be fair, the toolchains like GCC are quick to take up new/experimental features, but a lot of codebases are simply slow to port them.
<stis>k
<leoprikler>Btw. Guile does have destructors in the name of "finalizers".
<str1ngs>leoprikler: do you know if that works for goops?
<stis>leoprikler: yep
<dsmith-work>leoprikler: Yes. Unpleasant. Like assigning to a typoed variable name. Then wondering why the real var was undefined.
<leoprikler>str1ngs: finalizers? I think it's more of a FFI thing, but maybe there's some GC hook for that
<str1ngs>gotcha, thanks
<leoprikler>I'm pretty sure CPython also has some kind of finalizer/destructor in its FFI
<dsmith-work>More OffTopic: I've been learning Rust lately, and I *really* like it a lot. I need some decent static typing after Python.
<dsmith-work>I had this horrible python work flow. Was on embedded Linux. The "drivers" for our plug in cards were in python. Needed to build,burn,and boot a firmware image to test.
<stis>leoprikler: maybe the __del__ destructor
<leoprikler>I knew it had to exist
<stis>dsmith-work: rust looks really nice, heard that it has a great compiler
<leoprikler>I know that feel. I worked at a company, where in order to run some software I had to compile it, then place it in a special location in some other project, compile that, then run some hardware-emulating GDB magic for testing.
<leoprikler>I actually managed to automate most of it using carefully handcrafted Makefiles.
<leoprikler>(I even learned M4 at the time, because for some reason autotools was too much, but m4 still existed)
<dsmith-work>leoprikler: Yes. I used buildroot, which is all makefiles.
<stis>+1
<dsmith-work>m4 is actually pretty cool on it's own. Long ago was using some freebie dos 68k assembler from moto with no macros. M4 made it pleasant.
<ArneBab>stis: wow, nice! (re unit test framework); we might get to do some semi-realworld-performancetesting with that
<leoprikler>Hard agree, that job really made me appreciate M4's existence.
<stis>ArneBab: the latest releases should be a lot faster made a lot of effort on that this spring
<dsmith-work>sneek: botsnack
<sneek>:)
<pkill9>how do you read html with guile?