IRC channel logs

2025-02-24.log

back to list of logs

<andreas-e>Hello! I am getting back to goblins, and have trouble running my previous example from https://enge.math.u-bordeaux.fr/miscellanea/goblins-2.html
<andreas-e>It turns out that there is a small non-compatible change from goblins 0.13 to 0.15: I had to replace "(new-onion-netlayer)" by "(spawn ^onion-netlayer)". But then the next line containing "(ocapn-id->string id)" fails with the message "Not a OCapN ID #<local-promise>"
<andreas-e>I thought that maybe I had put things together incorrectly, and tried to run the Alice-and-Bob-chat client from https://files.spritely.institute/docs/guile-goblins/0.15.0/Example-Two-Goblins-programs-chatting-over-CapTP-via-Tor.html
<andreas-e>The Bob part also fails, but with a different error message:
<tsyesika>Not at my computer right now but registering a sturdyref can return a promise
<andreas-e>"captp-bob.scm:20:2: Wrong number of values returned to continuation (expected 3)"
<tsyesika>with-vat net ($ mycapn 'register client 'onion)))
<tsyesika>^ returns a promise
<andreas-e>Is this new? I let it follow by "(define uri (ocapn-id->string id)) (format #t "Client ID: ~a\n" uri)" where id is the promise returned by the 'register call.
<andreas-e>Your chat example does it all in one line, "(format #t "Bob's sturdyref: ~a" (ocapn-id->string bob-sref))"
<tsyesika>Yeah it’s new. When we aurified the netlayers it has some implications around this
<andreas-e>So then it looks like the chat example suffers the same problem. Something needs to be wrapped into "on", I think.
<tsyesika>Just checked the docs you linked they need updating
<tsyesika>I must have missed that example
<tsyesika>Sorry
<tsyesika>You need to use on when printing the sturdyref
<tsyesika>If you’d like to file an issue about the docs that’d be great :)
<tsyesika>I can fix it tomorrow
<andreas-e>Hugh, more promises, where I am already overwhelmed with the existing ones! It is sort of an example what I find difficult about goblins and all this promises business. I would like to define a string "uri", so here it would be nice to create a synchronisation point and wait for the promise to be resolved. Before Bob prints its uri, one anyway cannot start Alice.
<andreas-e>I will file an issue, sure.
<andreas-e>Thanks for the quick reply!
<andreas-e>The situation is similar to what I encounter with my computations. Sometimes I would just like to wait for all my promises to resolve to values.
<tsyesika>No problem. The reason why by the way is that you can spawn a netlayer and behind the scenes it needs to speak to for example the tor daemon and ask it to setup a hidden service and provide the keys and things to it. That’s an inherently asynchronous operation.
<tsyesika>I’m bias but I tend to think the best way to use goblins is to embrace promises. Granted it’s a bit of a shift in thinking about writing code
<andreas-e>I agree with the Tor point. The main code can potentially continue and do something else while waiting for Tor.
<dthompson>thanks for the bug report andreas-e
<andreas-e>Welcome! Thanks for the quick help time and again!
<andreas-e>Something that also seems to be new is "imported module (goblins) overrides core binding `spawn'". Could this be avoided? Or "spawn" be renamed?
<dthompson>it's unfortunate that the warning is happening again, we're going to make that go away.
<dthompson>a core operator in goblins is 'spawn' and it predates guile adding spawn to the default namespace
<dthompson>we need to adjust the (goblins) module to indicate that our spawn replaces guile's spawn when you import it
<andreas-e>Okay!
<dthompson>we changed some things for hoot compatibility and the darn warning snuck back in when we did that