IRC channel logs

2020-12-03.log

back to list of logs

<leoprikler>It's great to see how far in the past Wikipedia can be at times: "PyGTK will be phased out with the transition to GTK version 3 and be replaced with PyGObject."
<dissoc>what is the proper way to write code for multiple functions to
<dissoc> execute on a data structure to keep the code more readable??
<dissoc> (do-something-1 (do-something-2 (do-something-3 %my-list)))? is there something similar to threaded macros like in clojure?
<leoprikler>(define do-something-big (compose do-something-1 do-something-2 do-something-3))
<dissoc>excellent. thank you very much
<leoprikler>daviid: https://gitlab.gnome.org/Infrastructure/gtk-web/-/merge_requests/104
<daviid>leoprikler: nice, where do i click to see the change you proposed, in that page 'request?'
<leoprikler>you can either go to the changes or browse the pipeline
<daviid>i really think, if that is not the case yet, that we shgould refer to "Guile Scheme" in the titles, every where, thenin the apropos before G-Golf and Guile-GI, saying thet guile scheme is, and is par t of gnu (so is G-Golf by the way ...
<daviid>ahok, you did call it guile scheme, excuse my note then ...
<leoprikler>I did not yet write "GNU G-Golf" though
<daviid>leoprikler: great, because now, the parent page will list 'us' as is, if the change is accepted, thanks so much, let's see
<daviid>leoprikler: it's not important, at least not for now
<daviid>leoprikler: the important thing is "Guile Scheme", in there, in the parenbt page, and hopefully in the front page ... then users who are interested will end-up visitig guile-gi and/or g-golf pages ... but you may add GNU G-Golf if you wish, for me it's ok either way ...
<daviid>i'd say let's wait to see if they accept this change request first ...
<leoprikler>I have a bad experience with changing merge requests post initial commit, so I'll let it sit until someone responds anyway.
<daviid>leoprikler: i totally agreee with you, let's wait
<leoprikler>FWIW people will notice that you're hosted on gnu.org since links come in full text
<daviid>leoprikler: right this to ... so now, can I sea a 'renedered' version of your request, or is it just waitit till it rebuilds?
<daviid>*see :)
<leoprikler>the CI pipeline did already finish
<leoprikler> https://leoprikler.pages.gitlab.gnome.org/-/gtk-web/-/jobs/1020723/artifacts/public/docs/language-bindings/guile.html
<daviid>leoprikler: perfect, tx
<daviid>leoprikler: does one has to proporse a change of the parent page as well, or this is all auto when accepted?
<leoprikler>I'm not sure what you mean by "parent page"
<daviid>I mean the 'Language Bindings' on the left, is the page users land when they click 'other bindings' on the front gtk.org page
<leoprikler>that sidebar is likely auto-generated
<daviid>ok, so i guess the page as well, this page i mean - https://www.gtk.org/docs/language-bindings/
<leoprikler>nope, that is hand-written
<daviid>hum i see that page lists "Scheme' on its left menu, then not in the page itself ... maybe a bug in tehir CI, don't know
<leoprikler>I don't have enough experience with Guile-GI or G-Golf to claim that either support Gtk 4
<leoprikler>no it's not
<leoprikler>they also mention D and Go, but those don't have subpages
<daviid>leoprikler: i am prety sure they do, but i can't compile gtk4 now, i tried ... it will be in debian testing soon, it is in experimental, but the gnome team told me it is too old to be usefull to try anything with it
<daviid>leoprikler: right i did see that too, and i thing these D and Go are recent
<leoprikler>Go is at least older than the Scheme subpage
<daviid>ok, anyway, we need to be on this page as well, in the menu on the left (I guess it will be update after your last request is accepted, if it is ...) and in the page itself ... would that be a manual change we need to provicxe them with as well then?
<leoprikler>you say that, but how exactly do you want me to do this?
<leoprikler>the format is <language | link to single binding impl> <supports v3> <supports v4>
<daviid>leoprikler: hum, i guess Guile Scheme v3 not v4, we will update with v4 asap
<leoprikler>and simply link to the subpage instead of the impls?
<daviid>leoprikler: or maybe we should wait then, not sure anymore :)
<leoprikler>I mean, it would make sense if *all* the table entries could link to their respective subpages, buuuuuuuuut…
<daviid>let's wait for that page then, they told me they are reforming thing for 4.0, i don1t you to loose too much time on this, you have done much already ... tk again
<leoprikler>no problem, let's see how things look after 4.0 hits
<leoprikler>btw. any news on that 0.1 release for Guile 2.2?
<leoprikler>or are you planing to do 3.0 compat before that?
<daviid>leoprikler: yes, let's wait their 4.0 pages reform(s)
<daviid>compat with 3.0 depends on guile maintainers, i need to fix one more important bug, complete the user manual, then i'll release, but i don't want to promise any specific time, i am on it, all i can say ...
<daviid>leoprikler: i have to go now, bbl, tx
<leoprikler>I should sleep too
<daviid>good sleep then
<daviid>dsmith-work: hey, nice Gtk/Scheme 1997 quote :), once they will have accepted all our request, if they do ..., and everybody is cool, relax, 'in peace', i'll ask them 'what happened? why on earth aren't all (gnome team written) applications written using guile? :):) - and post the quote, then suggest they ask that question to the 'hitch hickers guide to the galaxy computer' :)
<tohoyn>sneek, botsnack
<sneek>tohoyn, you have 1 message!
<sneek>tohoyn, daviid says: you can certainly prepare things, and I will be pleased when G-]Golf is in debian, but I have to warn you that it might take more tjime and be more dificult then it seems - (a) g-golf doesn't not work with guile 3.0 (which introduced changes in the module system, that breaks module-use!) and debian wants to withdran guile-2.2 from bullseye
<sneek>:)
<ArneBab>daviid: as an example of two implementations you can note xlib and xcb
<leoprikler>daviid: GObjectIntrospection happened.
<leoprikler>IOW they used XML instead of Scheme, probably so that they wouldn't have to fire up an interpreter in an interpreter
<leoprikler>it would be worth to adapt some existing code to use guile, however, e.g. replace Script-Fu in GIMP
<srandon111>people let's admit it... guile is a failed project
<sneek>Welcome back srandon111, you have 1 message!
<sneek>srandon111, catonano says: no sorry i don't recognize you ! Who are you on the fediverse ? 😀️
<srandon111>sneek, what's up ?
<leoprikler>srandon111: how so?
<ArneBab>srandon111: I disagree
<srandon111>leoprikler, give a look at the docs
<srandon111>most of the stuff is cryptic
<srandon111>no examples
<srandon111>difficult to advertise the language
<davidl>leoprikler: thx, delete-duplicates works just as well.
<RhodiumToad>it certainly failed at the goal of being the extension language for everything.
<srandon111>RhodiumToad, yeah
<davidl>srandon111: is guile not a revived project thanks to Guix?
<davidl>srandon111: you are certainly right though regarding examples in the manual.
<leoprikler>I don't really know about "most of it", but yeah, some of it certainly is.
<leoprikler>That being said, I've found the manual useful more often than not.
<leoprikler>as far as being a universal extension language is concerned, so did tcl and every other language that wants to claim a huge market share
<ArneBab>srandon111: there are too few examples, that’s true. But Guile is a language in practical use.
<ArneBab>It is also continuously improving and I use it for most of my personal tools.
<leoprikler>even Javascript, the de facto language of current year and all years to come due to browsers is replaced with other languages all of the time
<davidl>srandon111: have you tried emacs+geiser+guile? It's really nice, hard to leave. With some updates to the manual I think it could slowly gain a significant amount more attraction than it seems to have done so far, also thanks to Guix.
<srandon111>ArneBab, wht do you mean in practical use?
<srandon111>davidl, yes the problem is still updates to the manual also the fact that there are no cookbooks book
<srandon111>but only the single manual
<srandon111>as i said it makes the experience more cryptic and frustrating
<ArneBab>I mean that nowadays my whole system is controlled by Guile (via Guix) and I write most of my tooling in Guile.
<ArneBab>The experience is less smooth than with Python, and there are fewer libraries, but it is similarly nice to use.
<ArneBab>(after a more rocky start)
<leoprikler>cookbooks for a language are hard to get right
<leoprikler>it might work for DSLs like Ren'py, but even Vala, which limits itself to "just" the GNOME ecosystem can't possibly cover all use cases in a cookbook
<ArneBab>We don’t have to cover all use cases. We just have to cover the common ones. For the rest there’s the reference manual.
<ArneBab>srandon111: did you already have a look at SRFIs? Those are an essential part of Guile.
<srandon111>i wasn't brave enough ArneBab
<srandon111>after having given a look at the docs
<ArneBab>srandon111: try it with this? http://www.draketo.de/py2guile
<srandon111>ArneBab, wow thanks that surely helps!
<ArneBab>My first step into Guile Scheme was http://www.phyast.pitt.edu/~micheles/scheme/
<srandon111>ArneBab, are you aware of other books made as cookbooks or similar to these ones for other schemes? e.g., chez/chicken ?
<srandon111>ArneBab, i actually know some scheme
<srandon111>i used to do something with racket
<srandon111>although it's not considered a pure scheme now
<ArneBab>srandon111: I wrote py2guile — I wrote it while moving to Guile
<srandon111>ok thanks ArneBab
<ArneBab>(just so you know that it’s subjective)
<srandon111>i think that people like is what the guile community needs
<davidl>leoprikler: I tried to write some slightly advanced SXPath expressions with guile - and the manual section on that is really crypic. I had to find this from 2004: http://okmij.org/ftp/Scheme/lib/SXPath.scm and half-way through there is a test suite showing the corrsponding SXPath expressions. Things like that should be in the manual.
<ArneBab>srandon111: I’m not aware of other cookbooks
<davidl>...or in some cookbook.
<srandon111>ArneBab, ok ihavee to popularize yours then
*ArneBab is happy :-)
<srandon111>davidl, that's the thing there are no cookbooks
<ArneBab>I have a (still) handwritten article how I develop with Guile Scheme nowadays (with records, let-recursion and inner defines) — but I’ve been planning to type it for more than a year now …
<davidl>srandon111: yeah its unfortunate. Im still hopeful though :-)
<ArneBab>records are what’s mostly missing from py2guile, because I only understood them much later — but they should be introduced very early.
<ArneBab>srandon111: and you can do things with Guile that I have not seen anywhere else. These two are my examples:
<ArneBab>- https://hg.sr.ht/~arnebab/dryads-wake/browse/dryads-wake.w?rev=c677727bbd2c#L1219 — see https://archive.fosdem.org/2017/schedule/event/naturalscriptwritingguile/
<ArneBab>- https://hg.sr.ht/~arnebab/wisp/browse/examples/hamming.w?rev=ad2b1867648a#L64
<ArneBab>But do look at Guix
<ArneBab>It’s a distro that doesn’t break if it loses power during an update
<ArneBab>(and it is more idiomatic Guile than what I do)
***zap is now known as zzappie
<leoprikler>Do Guile's hash table handles remain valid for as long as the table is not cleared?
<leoprikler>(or well, remove is called)
<civodul>leoprikler: what do you mean by "valid"?
<civodul>ah sorry
<civodul>by "handle", you mean the key/value pairs?
<civodul>i would not attempt to capture them
<civodul>resizing the table may invalidate those pairs
<civodul>and resizing can happen "anytime"
<leoprikler>thanks for clearing that up
<leoprikler>if I use something mutable as cdr, that will stay the same throughout resizing, though, right?
<leoprikler>e.g. (hashq-create-handle myhash key (make-variable value)) => $1
<leoprikler>(let ((var (cdr $1)) ;; capture var …
<civodul>sure, values associated with keys remain valid
<civodul>fortunately :-)
<dsmith-work>daviid: When Gnome was just a hacker project, Scheme was cool, but as soon as all the paren-phobic commoners arrived, it fell out of favor..
<chrislck>question: Why does (export <identifier>) fail with Bad symbol to module-add: <identifier> is a make-record-type getter/setter?
<leoprikler>Ehm, what does the full code for that look like
<leoprikler>do you have (define-record-type ... (field field-getter field-setter)) (export field)?
<mwette>I have a macro for the iteraction over cartesian products I asked about yesterday. The format is `(for-each-combo proc l1 ...)' where l1 ... are N lists and proc is a procedure taking N arguments, one from each list. See here: https://paste.debian.net/1175480/
<mwette>it's not quite working yet, but getting close
<mwette>correction it is working -- I left 1st line off expected output.
<leoprikler>small comment regarding the variable names: I think arg<n> and i<n> would be a little clearer
<RhodiumToad>surely there must be an easier way
<RhodiumToad>you don't care about the return values?
<fnstudio>hi! what's the equivalent of `(filter even? '(1 2))` if i want to filter true values?
<fnstudio>basically, what's the idiomatic/right way to check `true?`?
<fnstudio>actually, i'm interested in `count`, i think
<fnstudio>as in `(count true? a-false-true-list)` to count the times true occurs in the list
<fnstudio>but i'm the feeling i'm missing something very obvious
<RhodiumToad>(count identity blah) ?
<RhodiumToad>note that anything that isn't #f counts as true
<fnstudio>let me try
<fnstudio>thanks, noted with regard to all that's not #f is passed as #t
<fnstudio>RhodiumToad: (count #t my-list) doesn't seem to work
<RhodiumToad>because #t isn't a procedure
<fnstudio>oh
<fnstudio>you actually meant identity
<fnstudio>sorry
<RhodiumToad>count applies the procedure to each list element and counts the number of times that the application returned a true result
<fnstudio>and identity is a procedure... cool
<RhodiumToad>yes, (identity x) just returns x
<fnstudio>very cool
<fnstudio>thanks RhodiumToad that solved my problem, much appreciated!
<RhodiumToad>(map (compose not not) somelist) will take a list and change all the true values to #t, leaving #f alone
<fnstudio>that sounds like something that will come in handy at some point, good to know, thanks
<fnstudio>is there an exclusive or available somehow built-in?
<RhodiumToad>one that works with arbitrary values, not just #t and #f ?
<fnstudio>RhodiumToad: just #t and #f
<RhodiumToad>(not (eq? a b)) works for that, whereas (eq? (not a) (not (not b))) works in the more general case
<fnstudio>excellent, i should have thought of that
<fnstudio>thanks
<dsmith-work>RhodiumToad: Didn't see the double not on the second example.
<dsmith-work>Had me tied up in nots thinking about how it's not the same..
<RhodiumToad>(not (eq? (not a) (not b))) also works
<RhodiumToad>so with regard to cartesian product macros, how about https://dpaste.org/spD1
<RhodiumToad>(but if I needed a cartesian product, I'd think twice about making it a macro)
***jonsger1 is now known as jonsger
<leoprikler>RhodiumToad: That creates N lambdas, which might not be what you want
<leoprikler>mwettes solution is better in that regard, since it only uses a few lets
<leoprikler>though I'm not sure how it compares performance-wise to mine or foof-loop + generators
<RhodiumToad>I wouldn't do it as a macro except perhaps as an optimization. seems to be no reason for it
<leoprikler>sure, just wanted to point out that you can optimize it as procedure
<mwette>I think non-macro solution is preferred, but I could not think how w/o generating a single list-of-lists first, and that not scale well wrt memory usage.
<RhodiumToad>what memory usage are you concerned about?
<RhodiumToad>are you going to be calling this a very large number of times on small lists, or fewer times on very large lists?
<mwette>prod of ten lists of ten items would generate 100 lists of ten items.
<mwette>vs my macro which generates no extra lists, just lots of references to pairs
<mwette>(lots = ~ twenty)
<mwette>weakness of my macro design is that null? is evaluated a lot
<RhodiumToad>how many lists do you expect to be using?
<mwette>but I can fix that
<mwette>three
<RhodiumToad>always?
<mwette>If I design an algorithm, I want to be able to use it later for other purposes.
<RhodiumToad>sure