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>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>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. <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>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>dthompson: would a "load-quickly" example with the hello world help you? <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>(to avoid mutating the global fetch options which could break other libraries) <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.