IRC channel logs

2020-04-23.log

back to list of logs

<rndd>mwette: thanks!
<RhodiumToad>(add-to-load-path (dirname (current-filename))) from inside a guile script can be handy
<anadon>Good evening all
<anadon>Does anyone have advice for creating a program which stores file data with flexible metadata, transparently decrypts and encrypts said data, supports POSIX operations from C, and supports networking and distributed/sharded file data? There is a lot to unpack here, and I'm not skilled enough to unpack it myself yet.
<dsmith-work>anadon: Ya, that seems a little confused to me.
<dsmith-work>anadon: Is that from some kind of requrements doc written by a committee?
<dsmith-work>It's the OS and library that would support POSIX calls from C.
<dsmith-work>"flexible metadata" is kind of nebulous.
<dsmith-work>(Sorry. I'm not helping much, am I)
<RhodiumToad>"flexible" presumably in the sense of not conforming to some fixed predefined schema.
<anadon>RhodiumToad: Yup. Something that the user can do what they will with it.
*RhodiumToad mumbles "xml" quietly
<anadon>I'm trying to design and implement, effectively, a filesystem with web support minus low level disk stuff.
<anadon>No way in hell am I going to pull an XML.
<dsmith-work>fuse ?
<anadon>dsmith-work: FUSE is probably a good idea for this to plug into.
<dsmith-work>I've never looked at that before, but I would imagine that has all the entrypoints you would need to implement.
<dsmith-work>I mean, everything to make it look like a filesystem.
*RhodiumToad understands that xml is widely hated, but it does look like it could be useful here
<dsmith-work><cough>sxml</cough>
<dsmith-work>Everything is JSON and YAML these days.
<anadon>By XML I took you to mean the parent standard SGML.
<anadon>Given how overbearing XML is, I don't think it is fitting. For being able to interpret things, I intend to use some Lisp-thing to represent data.
<RhodiumToad>well this is kind of the anti-xml attitude I was referring to previously
<RhodiumToad>to give a real example, suppose I have something like
<RhodiumToad><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:creator>Me</dc:creator><dc:date>whenever</dc:date><dc:rights>...</dc:rights></metadata>
<RhodiumToad>then (a) anything can interpret that, even a human; (b) anything that cares can validate it; (c) anything that wants to add more metadata with a different schema can do so
<RhodiumToad>of course you can store that as sxml if you prefer
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>sneek: seen rlb?
<sneek>rlb was in rlb ago, saying: 4 days.
<dsmith-work>Bah
<RhodiumToad>a veritable bug
<dsmith-work>sneek: seen RhodiumToad ?
<sneek>I last saw RhodiumToad in (here?) ago, saying: 46 minutes and 30 seconds.
<dsmith-work>Heh
*RhodiumToad wonders if the bot counts actions
<RhodiumToad>46 min 30 sec would be about right if it doesn't
<dsmith-work>sneek: seen RhodiumToad ?
<sneek>RhodiumToad was in (here?) 47 minutes and 56 seconds ago, saying: "flexible" presumably in the sense of not conforming to some fixed predefined schema..
<dsmith-work>Ok!
<dsmith-work>sneek: seen dsmith-work?
<sneek>dsmith-work was in (here?) 31 minutes and 22 seconds ago, saying: Everything is JSON and YAML these days..
<RhodiumToad>why the (here?) ?
<dsmith-work>The old db table didn't have the channel.
<RhodiumToad>sneek: seen dsmith-work?
<sneek>I last saw dsmith-work in (here?) 32 minutes and 6 seconds ago, saying: Everything is JSON and YAML these days..
<dsmith-work>Supposed to be populating with the chan
<RhodiumToad>it doesn't seem to be making new entries?
<RhodiumToad>sneek: seen sneek?
<sneek>Sewni was in (here?) 7 months ago, saying: I didnt realise you were using the bot :P.
<RhodiumToad>heh
<RhodiumToad>fuzzy matching?
<dsmith-work>There was some. I've disabled that. "seen" would match the bot nick.
<dsmith-work>foo bar is the best baz I've ever seen
<dsmith-work>That used to trigger the bot
<RhodiumToad>sneek: seen dsmith-work?
<sneek>dsmith-work was in (here?) 37 minutes and 55 seconds ago, saying: Everything is JSON and YAML these days..
<dsmith-work>RhodiumToad: The db is not being updated.
<dsmith-work>RhodiumToad: The db is not being updated.
<dsmith-work>Ok.
<dsmith-work>sneek: seen dsmith-work?
<sneek>dsmith-work was in #guile 13 seconds ago, saying: sneek: seen dsmith-work?.
<dsmith-work>goodbot
<dsmith-work>sneek: seen civodul?
<sneek>civodul was in (here?) 2 hours ago, saying: it's #guix, not #editors :-).
<dsmith-work>RhodiumToad: Say something.
<RhodiumToad>moo
***wxie1 is now known as wxie
<RhodiumToad>this is only a test. had this been a real emergency, we would all have fled in terror, and you would not have been informed.
<anadon>RhodiumToad: I want data to be interpreted by substance and structure rather than something explicit. The explicit route has always been opt-in, and I really want something that is more opt-out.
<dsmith-work>One more change to make is record the (current-time) seconds instead of the date as text like 'Apr 23 at 12:28 am'
<RhodiumToad>what database are you using, out of curiosity?
<dsmith-work>sqlite
<RhodiumToad>seems reasonable
<dsmith-work> https://gitlab.com/dalepsmith/guile-sqlite
<dsmith-work>the bot has been using that for over a decade. SAME db file. (copied from machine to machine occsionaly)
<dsmith-work>RhodiumToad: The seen time is off right now by +- 30 seconds, because only the minute was saved.
<dsmith-work>Not that it matters too much. But it annoys me a bit.
<dsmith-work>ok
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>sneek: seen someunknownnick?
<sneek>Not as far as I can remember.
<anadon>In https://www.gnu.org/software/guile/manual/html_node/Sandboxed-Evaluation.html , security notes point 4, are mutation risks only a concern for variables passed into a sandboxed execution?
<anadon>I'm having trouble parsing that section.
<dsmith>"Mutation may allow a sandboxed evaluation to break some invariant in users of data supplied to it." Sounds like just the stuff passed..
<dsmith>When did this sandbox stuff appear? Never seen it before.
<dsmith>AN example or two would be nice.
<dsmith>sneek: seen wingo?
<sneek>wingo was in (here?) 7 days ago, saying: à demain.
<anadon>dsmith: Good enough for me. I won't be passing anything in.
<tohoyn>daviid: when I do (gi-import-by-name "Gtk" "ButtonsType" neither <gtk-buttons-type> nor gtk-buttons-type are defined. See https://paste.debian.net/1142354/ .
<tohoyn>daviid: BTW, when GTypes are passed as procedure arguments should we have types as GObjects instead of symbols?
<tohoyn>daviid: e.g. gtk-list-store-newv
<daviid>tohoyn: ButtonsType is an enumerted type - once imported, you may just use any of its member to what ver function needs a button type ... but if you want to inspect of cache for your own introspection use, or what eve reason, you may retreive its <gi-enum> instance as (gi-cache-ref 'enum 'gtk-buttons-type)
<tohoyn>daviid: ok
<tohoyn>daviid: should the name be <gtk-buttons-type>?
<daviid>no, these <...> arereserved for class name, in g-golf, enum, struct, boxed, are instances
<daviid>tohoyn: are <gi-enum>, <gi-struct> instances ...
<daviid>tohoyn: your last quizz, gtk-list-store-newv last argument is an array of GType (a pointer to a array of unsigned-long to be precise)
<tohoyn>daviid: I can't set a GObject-valued slot, see https://paste.debian.net/1142361/
<tohoyn>daviid: slot-set! expects a pointer
<tohoyn>daviid: is it possible to obtain the GType value of a GObject representing a class?
<daviid>tohoyn: so, from a g-golf user perspective, it is a list of members of %g-type-fundamental-types
<tohoyn>daviid: classes are GObjects, aren't they?
<daviid>yes, (!gtype-id <a-g-object-sbclass) - note that i plan to change the name of the slot and accessor to g-type, wll let you know
<daviid>wrt to your last paste, you should not use slot-set!, but the property accessor - slot-ref, slot-set! are not (they can not be) redefined, that is part of the clos/goops protocol
<tohoyn>daviid: ok
<daviid>if you use slot-set!, you're on your own, the value you pass is used 'as is' ...
<daviid>as a user you shouldn't need it, but if ... you may call !g-inst on any insyantiable GType class - so, all g-object subclass instance
<tohoyn>daviid: accessors don't work either. see https://paste.debian.net/1142363/
<tohoyn>daviid: is it possible to convert a GObject to a pointer?
<daviid>will look into this property 'object type problem
<daviid>i don't uderstand yu last question
<tohoyn>daviid: If I have a GObject can I obtain its address as a pointer?
<daviid>you mean a goops instance
<daviid>use !g-inst - but yu shouldn't need to manipulate those ...
<tohoyn>daviid: now it works. tx.
<daviid>but you shouldnt pass the poijter 'yourself' it is bug
<daviid>that i'm looking at ...
<daviid>i thught i had a test for this case, and used it while playing with clutter ... but apparently there still is a problem ...
<tohoyn>daviid: I suspect that the second argument of gtk-image-new-from-icon-name should be enum GtkIconSize instead of integer.
<rbonnal>Hello, I am very new to guile and I am staring using it because of #guix. I need to open in read mode a text file and printing each line on the stdout. I now that is a very basic use case, but i wasn't able to find an example online.
<daviid>tohoyn: that seems a GI typelib bug I'll ask about this on #introspection, tx
<tohoyn>daviid: can you check if https://paste.debian.net/1142366/ works for you? for me it prints boxes of hexadecimal numbers onto a window.
<rekado>rbonnal: here’s an example: (import (ice-9 rdelim)) (with-input-from-file "/home/rekado/hurd.txt" (lambda () (let loop ((line (read-line))) (unless (eof-object? line) (display line) (newline) (loop (read-line))))))
<rekado>(ice-9 rdelim) is the module providing “read-line”, which will read a line from the current input port.
<rekado>“with-input-from-file” takes a file name, opens it, sets the current input port to the opened file, and then calls the thunk.
<daviid>not now, i'm debugging this property problem we were talking about, but str1ngs reproted to yu that it works for him ... so i suspect something else then a g-golf bug ...
<rekado>the (let loop …) thing is called a named let.
<rekado>the name “loop” is arbitrary
<rekado>this will bind the result of (read-line) to the variable “line”; if the line is actually the end of the file we do nothing.
<daviid>tohoyn: but i would try not using ice-9 textual-port first
<rekado>if it isn’t it’s probably a line of text, so we display it and print a newline before calling (read-line) again and calling the “loop” procedure with the read line bound to “line”.
<rekado>so the procedure “loop” calls itself repeatedly until we reach the end of the file
<daviid>tohoyn: depending on your guile version and the port encoding, you need to set (the port enconding) accordinglu ...
<tohoyn>daviid: it may be a problem with fonts. When I change the font to Sans 18 it works.
<daviid>right, not a g-golf problm then
<rekado>rbonnal: there’s a faster way to just read and dump the contents of a file, in case you want that
<rbonnal>rekado: I really appreciate your help
<rbonnal>rekado: yes, to be honest I just need that at the moment; it is for debugging on guix the (substitute*)
<rekado>rbonnal: within Guix you can also be naughty and invoke any external tool as long as it is available in the build environment
<rekado>e.g. (invoke (which "cat") "the-file")
<rekado>the (guix build utils) module also has “dump-port” (which I thought was in Guile)
<rekado>it allows you to shuffle data from one port to another
<rekado>so you can open a file port as the input and (current-output-port) or (current-error-port) as the output
<rbonnal>rekado: cool :) I just need to play more with guile ad guix
<daviid>as thing are in g-golf, setting a property to a value returns the value, I wonder if it should not return anything insted, clos/goops would not return a value for these operations ...
<daviid>tohoyn: i now fixed the bug, still need to commit and push , but setting the parent of a newly created <gtk-message-dialog> appears t be an illegal ops - (guile:117725): Gtk-WARNING **: 05:29:11.011: Can't set a parent on a toplevel widget
<daviid>
<tohoyn>daviid: yes, setting the parent is unncecessary and wrong
<tohoyn>daviid: you can set the transient parent instead (with the corresponding function)
<daviid>tohoyn: would you have a valid example I could use to add to the test suite, that would be helpfull
<tohoyn>daviid: wait ...
<daviid>tohoyn: ok, but I pushed a fix, could you pull, make, check and then you paste a valid example, if you can ... but first check my fix
<daviid>tohoyn: so with this fix, yu should pass the goops instance to set property that aceept g-object (sub)class instance(s)
<daviid>and accessing the property should properly rtrive the goops instnace for you, or #f if none
<tohoyn>daviid: shall I set the property with slot-set! or use accessors?
<daviid>slot-set! will _never_ work for g-object properties
<daviid>nor slot-ref - properties are GValues ...
<tohoyn>daviid: ready: https://paste.debian.net/1142383/
<tohoyn>daviid: works fine
<daviid>ok perfect. now, this tells me that there will still be other property types that will need fix, as they appear so to speak - we'll fix 'on-demand
<tohoyn>daviid: do you know how I shall initialize the GValue when I set the font-desc property of GtkTextTag (type PangoFontDescription*) (this is C)
<tohoyn>daviid: I use function g_object_set_property
<daviid>tohoyn: you should not initialize the property yourself
<daviid>the property knows what type nd how to initialize its GValues ...
<daviid>*you should not initialze the g-value of a property yurself, never ever
<daviid>the only situation, unfortunately, when yu have to 'deal with' g-values is when a fnction needs 'in or 'inout arguments that are g-values - whch afaic is a design failure on the gnome side but that is another 'story' )
<daviid>tohoyn: PangoFontDescription is an opaque struct, yu should use its apito create, manipulate .... and 'blindingly' pass its pointer when accessing setting properties ...
<tohoyn>daviid: it works fine when I use function g_object_set (the output is not fine)
<daviid>tohoyn: you shouldn't use thos low level, never ever
<daviid>if you do, you'r on your own ... i can't help
<daviid>you break the protocol ...
<tohoyn>daviid: in C?
<daviid>oh, no in g-golf o course
<tohoyn>daviid: I wrote a C++ example program for the Courier font problem
<daviid>in C do as you wish :):)
<tohoyn>daviid: could you run the C test program if I paste it?
<tohoyn>daviid: I may file a bug in Gtk
<daviid>tohoyn: I'm too busy and not very interested I must confess, but maybe someone else here might help you
<tohoyn>str1ngs: are you there?
<daviid>tohoyn: with a good C snipset, you may try gnome irc channel
<tohoyn>daviid: ok
<daviid>but C, not C++, since gobject is there object oriented system...
<daviid>tohoyn: irc.gnome.org - fwiw hang on #introspection of course ..
<daviid>tohoyn: wrt to your question related to gtk-image-new-from-icon-name, I did ask on #introspection and they answered that it is int32 because users may specifiy a different size (in pixel) then those in the enum type
<tohoyn>daviid: ok
<daviid>they added that in Gtk4 it will take an actual GtkIconSize, fwiw
<dsmith-work>Morning Greetings, Guilers
<RhodiumToad>yo
<butterypancake>The other day #emacs was claiming that guile emacs would leave emacs in a worse place. They claimed if they wanted to change the elisp engine, they'd need programmers that understood C, guile, and elisp. They also said they can do more optimizations with an engine specific to elisp, like the upcoming gccemacs optimizations. They where kind of convincing so I want to see what you guys think to hear out both sides
<lfam>Do you have a log of the conversation butterypancake?
<butterypancake>I don't. Literally just started using irc yesterday because I was thinking of personally picking up the guile emacs project
<butterypancake>Maybe I should start looking into how to take logs :P
<butterypancake>One of their arguments was that the current guile emacs is slower than normal emacs. I thought that was because of byte compilations problems but they said it wasn't and it was just that elisp is faster than guile
<butterypancake>this is guile 2.2 in the current guile emacs though, and guile 3 is supposed to be like twice as fast
<lfam>I'm not that familiar with Emacs but my impression is that it's extremely complicated internally and that changing the underlying language implementation would require buy-in from a lot of people
<lfam>Because it would take a lot of people to complete the work
<rekado>butterypancake: the current Guile Emacs is not really current.
<rekado>it does not even use Guile 2.2
<rekado>I started rebasing the branch of Guile that Guile Emacs used, but there are a bunch of changes that need to be reviewed and adjusted.
<butterypancake>I mean one man created a working guile emacs. I would have to have support from the emacs devel mailing list, which I don't think would be super hard since RMS really likes guile. It would take a lot of work, but I think I could do it. Right now I'm trying to figure out if I should
<rekado>it’s slower because it currently doesn’t compile anything.
<butterypancake>ok, I thought that was the problem. #emacs seemed to think otherwise
<rekado>Emacs developers in general don’t like to hash out development plans by committee.
<rekado>they prefer to have someone show up and do the work and then demonstrate how it benefits Emacs.
<rekado>for Guile Emacs to ever succeed it would need people to actually take it serious.
<holomorph>and then derail in all whimsical directions
<rekado>only then would it get to a position where it could convince the Emacs community on its own merits.
<rekado>I’d like to see Guile Emacs become a viable alternative (perhaps merely as a configure-time option)
<rekado>and I hope that rebasing past work could encourage a little more development in that area
<butterypancake>I'd kinda feel bad for the gccemacs guy if guile emacs replaces his work though
<butterypancake>he's doing a lot of work making elisp compile to native machine code
<drakonis>its an experiment isnt it?
<butterypancake>it is, but it has a lot of hype around it.
<butterypancake>He posts in emacs-devel regularly and gets lots of praise and the reddit posts get a lot of attention
<rekado>isn’t that similar to Guile Emacs a few years back then…
<rekado>?
<butterypancake>most likely. But from what I can tell that was like 5 years ago, before I even used emacs
<rekado>does anyone have a good example for quasipatterns with (ice-9 match)?
<rekado>I’d like to build patterns from a list, but I don’t understand the documentation
<tohoyn>daviid: G-Golf autogen.sh (devel branch) gives an error. see https://paste.debian.net/1142583/
<tohoyn>daviid: I just installed Debian testing into a virtual machine
<emiller88>civodul: continuing over here from #guix
<tohoyn>daviid: Courier font worked ok in the new installation
<tohoyn>daviid: the autogen problem disappeared when I installed gettext
<Aurora_v_kosmose>Ah, I would have a log of that conversation, I think.
<civodul>emiller88: did the pkg-config trick help in the end?
<emiller88>civodul: Sadly no, I get `pkg-config --cflags guile-2.2: No such file or directory` whether I use nix-shell, or guix and different combinations of guile pkgs. It works if I just run the raw pkg-config though, just not in the Makefile.
<emiller88>If you have any other ideas I'm open to it but I started it yesterday to learn guile not how to get cflags to work in guix/nix :P.
<emiller88>I'd send the guix env to author if you do know how to fix it, I think that's the only thing wrong with the tutorial.
<civodul>emiller88: so you'll need to have Guile and pkg-config available/installed
<civodul>in Guix, this can be achieved with:
<civodul>guix environment --ad-hoc guile pkg-config
<civodul>in that shell, you can run: pkg-config guile-2.2 --cflags
<mwette>What about "make -p" to compare PKG_CONFIG_PATH to what's in your normal shell env?
<emiller88>mwette:
<emiller88>There isn't a PKG_CONFIG_PATH with make -p
<emiller88>civodul: Yeah that works, it doesn't work in the makefile, could I just put the raw path in there?
<mwette>I don't remember make well enough but if you are willing to try: make PKG_CONFIG_PATH=$PKG_CONFIG_PATH
<mwette>or hard code in the Makefile
<emiller88>Okay hard coding it worked
<emiller88>now it can't find gmp.h
<emiller88>Nvm that was because gnuplot wasn't in that env. Thanks!
<civodul>emiller88: it could be that your bash startup scripts are interfering, see footnote 10 at https://guix.gnu.org/manual/en/html_node/Invoking-guix-environment.html#FOOT10
<civodul>namely, "guix environment --ad-hoc guile pkg-config --search-paths" probably contains PKG_CONFIG_PATH, doesn't it
<emiller88>Alright no update needed, I got ahead of the tutorial which uses CFLAGS = `guile-config compile`
<emiller88>LIBS = `guile-config link`
<emiller88>Which works just fine
***heroux_ is now known as heroux