IRC channel logs

2026-01-09.log

back to list of logs

<ArneBab>sneek: later tell dthompson: did you make progress with define-syntax-rule support in the hoot repl?
<sneek>Will do.
<ArneBab>sneek: botsnack
<sneek>:)
<sneek>ArneBab: Greetings!
<dthompson>👋
<sneek>dthompson, you have 1 message!
<sneek>dthompson, ArneBab says: did you make progress with define-syntax-rule support in the hoot repl?
<dthompson>ArneBab: yeah that's working now that a port of guile's macro expander is in there
<dthompson>(hoot interaction-environment)> (define-syntax-rule (double x) (* x 2))
<dthompson>(hoot interaction-environment)> (double 42)
<dthompson>=> 84
<dthompson>speaking of the repl, for the first time ever I have just imported a library that wasn't already present inside the wasm binary.
<dthompson>just loaded srfi-1 from disk from inside wasm 😎
<ArneBab>dthompson: that’s cool! Thank you! Now I’ll have to figure out how to add the REPL to my learning Scheme booklet ☺
<ArneBab>And then it will finally be complete.
<ArneBab>dthompson: aside: did I show you the startup time optimization I did for hoot? ⇒ https://www.draketo.de/software/hoot.html (check the browser timing) -- it’s a mix of adding preloads in the HTML file and exactly matching the cors-properties in the js file: https://www.draketo.de/software/hoot.js
<dthompson>ArneBab: yeah but I haven't gotten around to understanding what's happening
<ArneBab>that way the js and wasm does not get loaded sequentially, but instead the fetches are initiated as the HTML file is parsed and the data then just reused.
<dthompson>thanks for looking into it, though
<dthompson>is it something that can be easily upstreamed?
<ArneBab>The key is rebinding fetch to having the correct credentials and cors mode: var f = window.fetch; window.fetch = (inp, ini) => f(inp, {credentials: 'include', mode: 'no-cors', ...ini});
<ArneBab>I think yes: it just needs to be put into the examples.
<ArneBab>(though a cleaner way would be to use matching options in hoot, but I’m not sure about the amount of testing …)
<ArneBab>you need <link rel="preload" as="fetch" href="reflect.wasm"> … and the same for wtf8.wasm and hoot.wasm … in the HTML file.
<ArneBab>if the wasm file would get loaded from another server, the mode would be wrong, though ⇒ complications …
<ArneBab>Just having that in an example would suffice to get people started, though.
<ArneBab>(feel free to use my code)
<ArneBab>dthompson: would a "load-quickly" example with the hello world help you?
<ArneBab>(if yes, I can file a PR for hoot)
<ArneBab>ACTION is still failing at getting the browser-based hoot-REPL to work -- will wait for a complete example.
<ArneBab>ACTION … complete updated example.
<dthompson>ArneBab: mainly I was looking for things that could be changed in the reflection library code
<dthompson>but the preload stuff could be put into examples/docs
<ArneBab>for the reflection, using different fetch options could be a problem. An option could be to add an option with fetch-parameters to Scheme.load_main, something like Scheme.load_main(bytes, { fetch_default_options: {...} })
<ArneBab>and then use those options for the fetches initialized by reflect.js
<ArneBab>and reflect.wasm
<ArneBab>(to avoid mutating the global fetch options which could break other libraries)
<dthompson>hmm yeah not sure how that would work
<ArneBab>(naming: or default_fetch_options … )
<ArneBab>it would need to store the options and then call every fetch as fetch(..., {...default_fetch_options, ...options}) with options being the options explicitcly passed to fetch.
<ArneBab>Then instead of the evil window.fetch = ... I could just do Scheme.load_main("./hoot.wasm", {default_fetch_options: {credentials: 'include', mode: 'no-cors'}, user_imports: ...}) and have hoot use the peloads from the HTML header.
<dthompson>I'll have to think about it a bit