IRC channel logs

2020-02-28.log

back to list of logs

<ZombieChicken>Is there any place with a comprehensive set of libs for guile?
<ZombieChicken>I'm specifically looking for something for termbox and, I think, linenoise
<daviid>ZombieChicken: here is , imo, the best list around - http://sph.mn/foreign/guile-software.html
<ZombieChicken>Thanks. Hopefully that will save me time in the long run
<daviid>dsmith-work: coud you tell our bot about this list, it is a bit foa faq i think
<daviid>*of a
<ZombieChicken>Hmm. I found something for termbox, but apparently the github is gone
<ZombieChicken>so Guile is R5 and R6 compliant?
<longshi>ZombieChicken: it's mostly r6rs compatible https://www.gnu.org/software/guile/manual/html_node/R6RS-Support.html
<ZombieChicken>okay, ty
<longshi>np :)
<daviid>str1ngs: I have worked and added support for GIInterfaceInfo, and so you ahould be bl to use it now, here is a tiny example - http://paste.debian.net/1132644/
<daviid>str1ngs: this is a wip, an as it is, any procedure or method that has interface arg or return value, expect and return the 'gnome' pointer, just like 'opaque' structures ... however, i need to enhance this so they become instances of their cprrespondng <interface> subclass, <interface> being a <gtype-class> subclass (just like <gobject>)
<daviid>str1ngs: this because (a) interfaces may have properties, and (b) they are a way that single inheritance languages found to paliate the lack of multiple inheritance ... so, in their 'world', properties are declared, but they must be 'implemented' by the class(es) that, well, 'implement' those interfaces ... it's such a mess, that they needed to 'change' the significance of fundamental words like implementing .., but anyway, in g-golf,
<daviid>after I enhance what I just did for GIInterfaceInfo, <gobject> sublasses that 'have' interfaces should just inherit those ... that's the plan, but i need to think a bit more about the design and the work on it ...
<daviid>str1ngs: but you should already be able to use iterfaces, in signal callback, interface args are pointers, that you my use to call interface methods, like in the example i pasted ... once these args/return value become instances, your code should even not change at all
<daviid>str1ngs: so, when you re willing to, pull, make ... and try ... tell me if your 'open signal callback (or any other) let you work with its GFile arg ...
<daviid>str1ngs: what won't work, till i enhance as describe here above, is/are interface properties, when they have properties (not all do have properties - g-file does not have properties)
<daviid>str1ngs: you may call g-object-type-name on an iterface pointer to get its 'subtype name' (which is considered an implementtion detail by the gnome team, so they are not 'public')
<daviid>for example, (g-object-type-name $3) -| $5 = "GLocalFile"
<daviid>str1ngs: afaict, all interface methods are now imported in g-golf
<str1ngs>daviid: good news, will test this out ASAP. thank you
<lispmacs>can we efficiently iterate through a bytevector without writing a C function? I mean, obviously we could make iterative calls to -ref functions, but that would require a large memory jump on each -ref call, right?
<lispmacs>as opposed to in C, where you could just increment a pointer
<lispmacs>like, say, if you wanted to multiple each float in a bytevector by 2
<daviid>lispmacs: you should use srfi-4, i think
<lispmacs>daviid: i do, but srfi-4 only allows you to reference by index
<lispmacs>so, presumably, each reference call must jump from the beginning of the bytevector to indexed element
<lispmacs>as opposed to simply grabbing the element that is, say, 4 bytes ahead in memory
<wleslie>"jump" ?
<daviid>lispmacs: grabbing the 4th element means you compute the position, that is what index will do using srfi-4, but you need homogeneous content
<wleslie>multiplication by a small, fixed power of two is not such a slow operation
<daviid>lispmacs: you can access bytevectors, exactly as in C, but notced those are actually slower then srfi-4
<daviid>basically, you tke the pointer address and increase by what ever value you need ...
<lispmacs>wleslie: so, say I've got a bytevector with 2 million elements, and I want to loop through, doing multiplication or whatever. Say, I call f32vector ref 10000
<lispmacs>f32vector must access the beginning of the bytevector, to figure out starting place of the data
<lispmacs>then grab the memory that is 10000 floats ahead of that
<wleslie>then the system multiplies the index, checks that it is within bounds, adds the base, fetches the value, and builds an SCM
<lispmacs>then next call is f32vector ref 10001
<lispmacs>so again, read beginning of bytevector, then read ahead 10001 float
<wleslie>it doesn't read the whole thing, no
<lispmacs>wleslie: well, yes, of course
<lispmacs>but point is it must read beginning of vector, then much later part of vector, each time
<lispmacs>whereas in C, I just increment the pointer 4 bytes, and read what is there, right next to my last read
<wleslie>I don't know if the compiler removes the read of the size field (it can't always do so), still, that value is going to be in cache
<lispmacs>hmm, okay. probably still more efficient with C, though, but the incrementing pointer could be in a register
<lispmacs>*but->because
<wleslie>right, but computing the pointer is not actually going to cost much
<daviid>the cost is in the conversion
<daviid>which is why in guile-cv, i wrote all these ops in C
<daviid>lispmacs: you might wana look at guile-cv, it's all done
<wleslie>ah, so you want to avoid tagging the index altogether?
<wleslie>I couldn't help but think that the newer compiler happily worked with untagged values
<lispmacs>I'm not sured exactly what that means, but I need to process like 8 million bytes per second, so efficiency definitely relevant in my case
<lispmacs>or, 8 million samples, like 64 million bytes in complex numbers
<lispmacs>daviid: is vigra C or C++ in the backend? a little confused
<daviid>lispmacs: i didn't use the C++ procs, because, Vigra C didn't bind those at the time, i think some are now available, but i already did write the algebra calculus in C, so i'll stick to this, till our compiler allows to 'reuse' the scheme code,which i kept commented ...
<str1ngs>daviid: in the example of this 'open callback (open app g-files n-files hint) is should g-files be a pointer?
<str1ngs>I would think it would be a list of pointers
<daviid>str1ngs: ah, that is still missing
<daviid>sorry
<daviid>i'll work on that asap, i forgot, i thought it was a *GFile, not a **GFile
<str1ngs>ok good to know, I want to make sure this was working as intended.
<str1ngs>I'll have to see if any of my other C functions use interfaces maybe I can convert those to scheme
<daviid>lispmacs: vigra_c is a wrapper of vigra
<str1ngs>the (open app g-files n-files hint) requires access to g-files to be useful for me.
<lispmacs>okay, so you effectively need to depend on a C++ library?
<daviid>i can only bind, in gule-cv, what is in vigra_c ... but vigra itself is C++
<daviid>str1ngs: will work on this top priority, will let you know
<daviid>lispmacs: more then half of the guile-cv code is pure scheme or C code that i wrote
<str1ngs>daviid: not a huge rush. I'll just hold off porting this signal from C to scheme.
<daviid>vigra is missing (i don't kow why actually) some fundamental image procesing procs, so i wrte those in either C or scheme
<str1ngs>I'll have to find another interface to test this further.
<daviid>lispmacs: delinate, imag reconstructon ... are not in vigra
<daviid>to name two :)
<daviid>lispmacs: anyway, one thing i should mention is that guile-cv is (because vibgra is) strict f32 based image processing lib
<daviid>i did think of generalizing and support other type, but right now, agebra calculus and all other img proc algorithms are f32 baased
<daviid>lispmacs: it would be easy to generalize and implement everything that's in guile-cv (for f32) for f64 as well
<lispmacs>when using statprof, how do you figure out what function an entry like "anon #x1db7d38" is referring to? disassembler output gives different addresses
<wleslie>you know that latest email on guile-dev about jitmaps? that.
<wleslie>otherwise, if you haven't built guile and your libraries with -g, that may give you something matching that address.
<lispmacs>I'm not subscribed to that list. Do you have a link to the thread handy
<daviid>wleslie: this 'problem' also happens with 2.0, 2.2, afaict
<wleslie>sure, but is the address within a library that needs to be compiled with debug symbols, or is it within your code compiled by guile?
<wleslie>on jitmaps: https://lists.gnu.org/archive/html/guile-devel/2020-02/msg00060.html
<wleslie>ah right, statprof is the guile-specific thing
<wleslie>this may be above my head, sorry
***sneek_ is now known as sneek
<b5n>Noob question, I'm trying to learn guile and I'm having some difficulty deciphering the manual. For instance, I am trying to sort a list, according the the manual https://www.gnu.org/software/guile/manual/html_node/Sorting.html#Sorting and (help sort-list) the command takes two argument a list and 'less' or 'less?'. When I use 'less' I get an unbound variable error, if I don't use 'less' I get a
<b5n>missing argument error. My goal is not to get help sorting a list, but too make sure I am reading the documentation correctly. Also, if anyone can point me to a doc outlining how to list loaded modules/procedures in an emacs helm buffer linking to documentation that would be really helpful, I haven't been able to find anything, but it seems like it should be relatively simple. Guile 3.0.0, Debian
<b5n>testing.
<daviid>b5n: less in the manual refers to the nme of the argument, you need to pass an adequate predicate for your list elements
<daviid>b5n: for example (sort-list '(5 4 3 2 1) <) -| (1 2 3 4 5)
<b5n>Thanks daviid.
<daviid>welcome
<daviid>str1ngs: in order to solve the <g-application> 'open signal callback first argument, so you receive a lst of pointers to GFile, and in the future a list of <g-file> instances, I need a bit of time: I need to enhance the way g-closure-marshal builds the callback arg list, which means to enhance g-closure-marshal-g-value-ref - which as it is, only knows that the argument gvalue holds a pointer
<daviid>str1ngs: to enahnce this 'state of things', g-closure-marshal should be able to access more info then those required to set!/ref gvalues. In order to achieve this, I need to effectively import signals (till now, g-golf dynmically build a <signal> instance calling g-signal-query, and that returns a fundamental type tag) and cache the information 'in a way that' both g-closure-marshal and g-closure-marshal-g-value-ref have access, so they
<daviid>can 'decode' the gvalue value ... it's going to take a few days I think
<str1ngs>daviid: okay it's not a rush, for now I just use this signal via C. which is pretty trivial with a custom typelib and g-golf.
<daviid>ok, will let you know ...
<apapsch>rotty: thanks for the pointer to fmt, from a first look it looks very promising
<rotty>in case it is helpful, there is an (very stale) R6Rs packaging of `fmt` at <https://gitlab.com/wak/wak-fmt> it might be useful to derive suitable Guile module definitions
<dsmith-work>Happy Friday, Guilers!!
<dsmith-work>daviid: sure
<dsmith-work>sneek: guile-software is at http://sph.mn/foreign/guile-software.html
<sneek>So noted.
<dsmith-work>sneek: guile-software?
<sneek>guile-software is at http://sph.mn/foreign/guile-software.html
<dftxbs3e>hello, what is the ",@(" syntax called?
<RhodiumToad>unquote-splicing?
<dftxbs3e>RhodiumToad, hmm okay. It looks like it solves issues with accessing variables in different scopes?
<RhodiumToad>not quite sure what you mean
<dftxbs3e>when I don't use ",@(" I get undefined variable error, and when I use it, it's gone
<RhodiumToad>right, but that depends on the context
<chrislck>,@(x) means call procedure x which returns a list, and insert the list in-place in the outer quasiquoted list
<mwette>Yes. See the Guile manual section "Reading and Evaluating Scheme Code"
<dftxbs3e>hmm
<dftxbs3e>I'm still new to Scheme. Thanks
<chrislck>`(a b c ,@(iota 3) d e f) --> '(a b c 0 1 2 d e f). that's all.
<RhodiumToad>more precisely ,@x evaluates x and splices in the result
<mwette>`(a ,(list b c) d) => (a (b c) d); `(a ,@(list b c) d) => (a b c d)
<dftxbs3e>That's what I want. But why does it throw an undefined variable error?
<dftxbs3e>(if I don't use it)
<RhodiumToad>just as ,x evaluates x and substitutes the result in place
<RhodiumToad>what's the surrounding context?
<dftxbs3e> https://gitlab.com/lle-bout/guix/-/commit/65bb12dfce6814eccefe5b7291362b75393c5805
<chrislck>mwette: I call ,@ the bully equivalent of , -- takes up more space in the bus!
<RhodiumToad>i.e. what are you doing with the result of the quasiquote expression?
<dftxbs3e>RhodiumToad, ^
<RhodiumToad>dftxbs3e: there must be a quasiquote (i.e. `xxx ) somewhere outside that?
<dftxbs3e>RhodiumToad, full file: https://gitlab.com/lle-bout/guix/-/blob/65bb12dfce6814eccefe5b7291362b75393c5805/gnu/packages/cmake.scm
<mwette>the code that follows , or ,@ must be a legal expression (x y) is not legal unless x and y defined and x is a procedure (or a is a macro)
<mwette>s/or a is a macro/or x is a macro/
<RhodiumToad>mwette: in this case it's ,@(if ...stuff...)
<dftxbs3e>I see the difference now
<dftxbs3e>Quite subtle
<dftxbs3e>is there a difference in how GNU Guile handles ` and ' ?
<RhodiumToad>` is quasiquote and ' is quote
<RhodiumToad>'x evaluates to x
<mwette>'(a ,@(list b c) d) => (a ,@(list b c) d); `(a ,@(list b c) d) => (a b c d)
<dftxbs3e>hmmm
<RhodiumToad>except that b and c are both evaluated in the second case
<mwette>oops : (list b c) => (list 'b 'c)
<chrislck>` is more clever than ' because ` can be temporarily disabled via ,
<dftxbs3e>o_O
<mwette>and you can imbed: `(... ,@(x ... `(... ,@(...) ) ) )
<chrislck>ok enough fun {farewell}
<dftxbs3e>I'll read a full book on it some day
<dftxbs3e>what can you recommend?
<chrislck>guile.pdf the manual ;)
<dftxbs3e>heh
<mwette>If you can download and build guile, then: cd doc/ref; make pdf
<mwette>guile.pdf is a ~1000 page manual with lots of useful info and good index
<mwette>my fav' book on scheme is "The Scheme Programming Language"
<mwette>dftxbs3e: your ,@(if ... ) needs to return '() for the false case
<dsmith-work>sneek: botsnack
<sneek>:)
<g0d_shatter>hey yall, I'm trying to compile gdb with guile scripting enabled and getting weird pkg-config errors, specifically "usable guile not found"
<g0d_shatter>this is the output from make https://dpaste.org/bmVS
<g0d_shatter>the configure options I used were: ../configure --prefix=/usr/local --with-system-readline --with-guile=/usr/bin/guile
<mwette>what system? (if ubuntu I know)
<g0d_shatter>debian
<mwette>may be the same. Is there /usr/bin/guile-2.2 but no /usr/bin/guild-2.2?
<g0d_shatter>nope
<g0d_shatter>no guile-2.2
<mwette>I'm lost; I've run into this (not for gdb) and ended up hacking things.
<mwette>does this work?: pkg-config --variable=guild guile-2.0
<mwette>you seem to have guile-2.0 ?
<mwette>guile --version returns what/
<g0d_shatter>yes its guile-2.0
<str1ngs>g0d_shatter: pkg-config --list-all | grep guile
<str1ngs>probably you need to install guile-2.2-dev
<str1ngs>or 2.0-dev I think 2.2 is probably preffered
<g0d_shatter>str1ngs: thank you for the help, it looks like i've got it to work now
<g0d_shatter>it was a wrong option being fed to the configure script
<dsmith-work>g0d_shatter: What was the correct option?
<g0d_shatter>dsmith-work: ../configure --prefix=/usr/local --with-system-readline --with-guile
<g0d_shatter>--with-guile being the correct invocation
<dsmith-work>Ahh
<g0d_shatter>I had been giving it --with-guile=/usr/bin/guile
<g0d_shatter>which is not kosher, apparently
<g0d_shatter>hence all of the pkg-config
<g0d_shatter>*pkg-config errors
***jao is now known as Guest2684
***Guest2684 is now known as jao`
<mwette>hmm. I just downloaded gdb-9.1 and I get the error wrt 2.0 you got, but guile --version returns 3.0.0. I used "--with-guile" in the configure.
<mwette>when I point (PATH and PKG_CONFIG_PATH) to my guile-2.0 install it seems to be working
***jao` is now known as jao