IRC channel logs

2022-02-03.log

back to list of logs

<gnousrick>anyone here has used GNUTSL-guile ? I found an old documentation for 3.5.3 version because the most recent version hasn't the Guile Reference for procedures. I don't understant everything and somes procedures aren't found, even using the example. if aonyone has an open source project using that..
<gnousrick>okay, I've checked the source code and it seems that the documentation is not update :/ lets goo to read all the source code to understant everything
<gnousrick>update, I found the documentation in info, somes procedures in the example have been removed but still in the doc (bruh), I'll check that tomorrow, gn
<stis>Hi guilers!
<vijaymarupudi>Hello!
<sneek>vijaymarupudi, you have 1 message!
<sneek>vijaymarupudi, ArneBab says: thank you!
<vijaymarupudi>I've been debugging an issue for 2 days now, and would like some help / second opinion. In this piece of code, why does Guile try to call `pattern-var' i.e. not expand `match' as a macro?
<vijaymarupudi> Clearly Guile knows that `match' is a binding from (ice-9 match), as removing or changing the use-modules results in match being undefined...
<vijaymarupudi> https://paste.gnome.org/pfzbpkrbo#line-26
<vijaymarupudi>This is for nectar <https://gitlab.com/vijaymarupudi/nectar>, that I'm hoping to release soon
<stis>vijaymarupudi: I think macro expansion directives must be at toplevel or under begin(s) nut buried in let's
<stis> (use-modules (ice-9 match))
<stis>(let ((test-expression '(begin
<stis> (use-modules (ice-9 match))
<stis> (define-syntax a-test-macro
<stis>works for me
<stis>(ignore the firs use-modules as I failed copying it)
<vijaymarupudi>(define-syntax ...) seems to work in a (let ...) though...
<stis> https://paste.gnome.org/puzsz6zko
<stis>works
<vijaymarupudi>Right, but for my use case, the use-modules would be an input to the macro, because I try to convert nectar syntax to an expression, and there's no telling where the use modules could be used.
<vijaymarupudi>For e.g. `This is a test @(use-modules (ice-9 match))' would be converted to `(top-level-macro "This is a test " (use-modules (ice-9 match)))'
<vijaymarupudi>I need the macro, because I need to capture the literals into a list
<vijaymarupudi>stis, you made me figure out a simpler reproduction, this fails: (let () (use-modules (ice-9 match)) (let () (match '(1 2) ((a b) a))))
<vijaymarupudi>Thanks!
<stis> https://paste.gnome.org/pr9601cw5
<stis>This does what you want, use-modules is the wrong tool
<stis>so essentially use-modules missbehaves in let's
<stis>vijaymarupudi: ^ ^
<vijaymarupudi>In a very odd and interesting way, it introduces the bindings (so works in one way), but doesn't understand that the bindings are macros (so doesn't work in one way).
<vijaymarupudi>Your advice is excellent, thank you stis, I think I will try to convert the use-modules to (module-use!)s
<vijaymarupudi>However I'm still interested as to why use-modules has this behavior.
<stis>note that the module-use! needs to be inside a macro else guile will not be able to expand at compile time
<stis>no idea why it does not work.
<vijaymarupudi>I see, thanks for the heads up stis!
<stis>note how I use it twise in the M macro, first to add the module so that macros can expand and then a version that are used ven all is evaluated
<vijaymarupudi>Right, compile time and eval time, nice
<stis>hmm reading the changelog for guile 3.0.6
<stis>this, In Guile 3.0.6, we fixed a longstanding bug using bignums
<stis>great, but then I need to fix some of my code that grovels the mpz datastructures.
<stis>(I know, i'm naughty)
<wingo>ft: javascript bignum implementations are generally less optimized than gmp's bignums, and it could be your browser doesn't include all the latest optimizations
<wingo>firefox for example doesn't include any of the fancy multiplication algorithms
<stis>yeah, prepared the mpz groveling I done in guile-log and guile-persists. Currently not much need to be done it seams,
<wingo>stis: what mpz work did you do there?
<stis>Ah, teh fruit of this day's project, to streamline myvector copy lib in C that can be potentially really really fast. Wondering if we should include it temporrarly untill guile's compiler reach magic speed
<stis>just fetch the mpz structure to bring out the bits, use it to store bitset inan indexing match for prolog and serializers
<stis>so fornow essentially the same routing can be used, but I expect that the format can change for 3.2
<stis>so I prepared for it a little
<wingo>neat
<wingo>yeah in 3.2 we can remove a couple of the inline fields in the SCM
<stis>wingo: if you want to see code explosions, consider checking the sources in my latest mail
<stis>1000:s of small optimized routines
<stis>for copying between different vector formats (scm vectors and bytevectors of all kinds)
<stis>lol
<ArneBab>stis: <3 — thank you!
<stis>I had one that negated, both bitwise and logically as well as affine transform between them.
<stis>but i guess that was overkill
<wingo>civodul: do you want the answer to the quiz? :)
<civodul>wingo: ah yes please!
<wingo>yeah so when you do the normal fac, you end up accumulating a bignum and each time multiplying by fixnums
<wingo>each multiplication cost is O(n) in bignum length, so total cost is n^2. however you can order the multiplications differently
<wingo>first to 1*2, 3*4, 5*6 etc, then pairwise reduce
<wingo>the result is that you end up multiplying bigger bignums against each other
<wingo>which can use more optimal multiplication algorithms
<wingo>basically because there's no real optimization for many digits times one digit but there are some optimizations for many digits times many digits
<civodul>yes, i got that from the JS comments
<civodul>so i did this: (define (fac2 n) (let loop ((lst '()) (n n)) (if (zero? n) (reduce * 1 lst) (loop (cons (* n (1- n)) lst) (- n 2)))))
<civodul>but it's no good because the final reduction is done on integers of different magnitude
<civodul>so we need a tree reduction but i stopped before i had found a way to do that elegantly :-)
<rekado_>would it help to start at the middle and multiply the previous with the next number until we hit 1*n? That would give you numbers that are somewhat closer to one another.
<civodul>could be!
<chrislck>sneek: botsnack
<sneek>:)
<rekado_>civodul: doesn’t seem to make a difference :( (I also replaced (reduce * 1 lst) with (apply * lst).)
<civodul>wingo: there's a new warning at integers.c:496:34
<wingo>civodul: (define (fac* n) (define (reduce n*) (match n* ((x y . n*) (cons (* x y) (reduce n*))) (_ n*))) (let lp ((n* (cdr (iota (1+ n))))) (match n* (() 1) ((x) x) (_ (lp (reduce n*))))))
<civodul>ah ha, thanks!
<avalenn>I have a problem trying to use define-record-type in one module and use the accessors in an other module.
<avalenn>message is Wrong type to apply: #<syntax-transformer mytype-myfield>
<avalenn>Oh! I cannot reproduce now. I must miss something.
<lloda>maybe stale object files
<avalenn>Maybe.
<sneek>wb dsmith :)
<dsmith>sneek: botsnack
<sneek>:)
<lfam>Hello from #guix
<lfam>I noticed that recently sneek has started welcoming people back to the channel
<lfam>Is it possible for me to turn this off for myself? I don't want my joins to be highlighted in this way
<lfam>And maybe we can just turn it off in #guix. Apologies if this has been discussed before
<maximed>New Scheme-GNUnet release: https://lists.gnu.org/archive/html/guile-user/2022-02/msg00011.html
<spk121>maximed: nice
<maximed>next step: whatever ERIS needs (is only the DHT sufficient? is gnunet-fs' reputation system required? ...)
<maximed>The goal is to integrate it with https://issues.guix.gnu.org/52555 such that we can have a form of decentralised substitution for Guix.
<dsmith>The bot just seems to like some people!
<lfam>:)
*sneek wags
<lagash>maximed: good job! I sadly will mostly be spectating until GNUnet/Taler matures more..
<apteryx>maximed: awesome. Can't wait to plug GNUnet with Guix.
<cwebber>hi hi
<drakonis>hey.
<cwebber>I'm enjoying guile hall a lot :)
<cwebber>there are things I can't figure out how to do with it yet but it's still good
<maximed>What new component would people be interested in for scheme-gnunet? GNS, FS, block, CADET, VPN ...?
<maximed>Or something wild like e.g. 'git over gnunet' (DHT + CADET + maybe GNS, maybe regex, maybe PSYC)?
<maximed>Or just implement a GNUnet backend for ERIS with raw DHT (without fancy FS reputation tracking or CADET offloading) for now?
<stis>o/
<mwette>anyone have a demo for (web client) using the Accept header?
<dsmith>mwette: Sounds familiar. Have you gotten anywhere yet?
<maximed>mwette: FWIW Guix sets Accept in guix/import/github.scm
<civodul>maximed: FWIW i'd suggest joining forces with ERIS
<civodul>looks like a promising approach
<civodul>so, for an uninterned symbol, there's no less than 7 words = 56 bytes of overhead (assuming the word used to store the size is not overhead)
<civodul>that includes 3 words for symbol properties, which we don't really use
<maximed>civodul: I'll submit a package definition for scheme-gnunet (gnunet-scheme?) first
<civodul>maximed: that's not the same as guile-gnunet?
<maximed>No, the guile library I wrote is a separate thing (it's a port of the client libraries instead of a binding)
<civodul>oh!
<maximed>though the idea is that eventually gnunet-scheme supports everything guile-gnunet does
<civodul>like it doesn't depend at all on the C code?
<maximed>civodul: 0%, unless gcrypt counts
<civodul>woow, nice!
<maximed>it has some advantages; it makes debugging and concurrency quite a bit easier
<maximed>(my C is rather rusty, and I often got segfaults when using guile-gnunet)
<dsmith>civodul: Hah! I guessed 8x
<civodul>dsmith: yes! so the cost is fixed, but for a symbol like "let", it's pretty high :-)
<civodul>for an interned symbol, it's different of course
<mwette>maximed: thanks -- I'll take a look