IRC channel logs

2026-04-21.log

back to list of logs

<dthompson>well we just got another ocapn implementation interoperating with us
<dthompson>this time it's the endojs implementation
<jfred>helllll yeah!
<janneke>dthompson: guile/guile/pulls/1 -- yeah, i should look at that because i've been writing my own json library, been using guile-json-{1,2,3,4}, wrote another version, but in this case i need to create a javascript json object ;)
<regtur>btw janneke I would gladly go the hoot way asap
<dthompson>:)
<dthompson>thanks for the PR janneke
<dthompson>I merged it
<janneke>dthompson: \o/
<janneke>hmm, must user_imports be duplicated for every .scm module, aren't they somehow shared?
<dthompson>what do you mean by duplicated?
<dthompson>I think I might know what you mean... we currently lack the tooling to compile together the js-side bindings
<dthompson>so you're on your own to setup user imports
<dthompson>this is something we intend to address when we have the time to invest into it.
<janneke>the hello example has document and element both imported in hello.js
<janneke>i would think there would be a document.js and an element.js, both with their .scm equivalents
<dthompson> https://codeberg.org/spritely/hoot-ffi-demo/src/branch/main/hello.js#L3
<dthompson>this is what you're referring to?
<dthompson>I mean, you're free to break the js side up into as many files as you'd like
<janneke>yes
<dthompson>but ultimately you need to produce an identical structure to what's in that file
<dthompson>because this is what WebAssembly.instantiate ultimately receives
<dthompson>WebAssembly imports use this two level naming hiearchy of module -> import
<dthompson>I'm not sure what the duplication is?
<janneke>ok, i'll try and play with it some more
<dthompson>in this repo I wanted each example to be completely standalone so new users had less abstractions to deal with
<janneke>as soon as I don't specify appendChild in the .js that matches the .scm, it seems not to be available -- but quite possibly i'm messing-up things
<janneke>i'm not being clear; if appendChild is defined in foo.js/foo.scm and that's included in the .html; and bar.scm also uses append-child, it seems that bar.js also has to have user_imports with appendChild
<janneke>i don't get any error, the web page just stays blank, which is pretty frustrating ;)
<janneke>but i'd probably better create an example somewhere if i need help; thanks for listening anyway!
<dthompson>I think I could help clear things up with a little more info. if you have two .wasm files then yes, you need to instantiate each with the necessary imports they require.
<janneke>right, so i have three .wasm files that have overlapping imports; that's where my question about duplication came from
<janneke>i can probably use a global js variable and use extend for the user_imports for those file or something to avoid that
<dthompson>an easy way is to just create the union of all 3 and import that into each
<dthompson>assuming no naming conflicts where imports of the same name have different function signatures
<janneke>right, makes sense; thanks!
<dthompson>np!
<dthompson>🦉
<janneke>user_imports: Object.assign ({}, hello_imports, javascript_imports, depyct_imports)
<janneke>and it works \o/
<dthompson>I think there's a compact syntax for this btw: { ...hello_imports, ...javascript_imports, ...depyct_imports }
<dthompson>glad it works :)
<janneke>ah right, we schemers *love* all those nice punctuation sugars, hell forbid someting like (union hello-imports javascript-imports ...)
<janneke>but thanks! ;)
<janneke>dthompson: about imports, and (scheme base); i figured-out two ways that work: https://paste.debian.net/hidden/9b327cdb
<janneke>figuring this out was a bit of work...which one would you suggest, or am i missing something?
<janneke>(the (hoot depyct) and (hoot javascript) are mine, possibly i should rename those)
<dthompson>what's the issue here? I'm not sure what I'm looking at
<janneke>the issue is that when using (import (scheme base) ..)
<dthompson>are you specifically trying to make an r7rs program?
<janneke>there is, eg, no read
<janneke>but you cannot import (hoot read), because that gives conflicts
<janneke>so then you have to do something like: (only (hoot read) read)
<janneke>or (only (hoot syntax) define-syntax-rule), to get define-syntax-rule
<dthompson>for r7rs you'd want to import (scheme read)
<dthompson>define-syntax-rule is guile-specific. for r7rs you'd want to use define-syntax-rules.
<janneke>ah, okay; thanks!
<janneke>so i gues the (scheme base) plus extras is the way to go
<dthompson>if you're sticking as close to r7rs as possible, yeah.
<dthompson>otherwise just use define-module to get the guile default environment
<janneke>oh!
<janneke>that would be nice, i'll look into that!
<dthompson>oh you're weren't aware that you could use define-module? interesting!
<janneke>nope, looked at hoot/examples/project-template/
<janneke>ACTION is pretty green here :)
<janneke>at least, hoot-wise
<dthompson>hoot supports define-library (r7rs), library (r6rs), and define-module (guile)
<dthompson>and of course our overall mission is to support as much of guile as possible
<dthompson>easier said than done of course :)
<janneke>hehe :)
<janneke>use-modules /define-module already addresses quite a bit of my reluctancy, how silly i didn't find this; *lovely*
<dthompson>be warned that there's many things missing from (guile) still, but should make your life easier anyway :)
<dthompson>heyyyy everyone guess what?
<dthompson>it's goblins release day!
<dthompson> https://spritely.institute/news/spritely-goblins-v0-18-0-sleepy-actors.html
<dthompson>we've got ocapn updates, bug fixes, and a new feature: sleepy actors
<dthompson>now actors can "go to sleep" meaning that they are persisted and removed from process memory until such a time that they are sent a message again
<fantazo>dthompson: so now we can all read our actors a bed time story? O_O
<Gooberpatrol66>-_-...ZZZZZZ
<dthompson>fantazo: yes!
<jboy>I have a hunch that that race condition bug was a nasty one to fix
<dthompson>jboy: you would be right!
<dthompson>jessica and christine hashed it out at fosdem and then we iterated on it more after
<dthompson>we fixed the correctness issue but there are still some programmer ergonomics issues
<janneke>does this ring any bell? -- reflect.js:1:1 Uncaught SyntaxError: redeclaration of let Port
<dthompson>haven't seen this one before
<dthompson>reflect.js has valid syntax, though. did something get messed up in your local copy?
<janneke>no, reflect.js is fine
<janneke>one .html page server ok, the next i get this error
<janneke>so i must have goofed-up in the second page somewhere...
<janneke>ah, i have a javascript library that has
<janneke>... class Port extends HasViz { ...
<jfred>sleepy actors sleepy actors! :D
<jfred>ok now I really need to get guile-horton supporting persistence
<jfred>especially now that there'll be ocapn interop with endo too
<jfred>there's a project I've got in mind where I want to mash both of those together