diff --git a/may_2025_thoughts.md b/may_2025_thoughts.md index 87a902b..6e6c2b1 100644 --- a/may_2025_thoughts.md +++ b/may_2025_thoughts.md @@ -1154,7 +1154,7 @@ That leaves the following list: - [x] delete generated .gitignore - [x] edit first line of rudus.js to import the local `ludus.js` - On this, made a justfile, but I needed to like actually try the build and figure out what happens. I got carried away touching the js. Too many things at once. -* [ ] design & implement asynchronous i/o+runtime +* [x] design & implement asynchronous i/o+runtime - [x] use `box`es for i/o: they can be reified in rust: making actors available is rather more complex (i.e. require message passing between the ludus and rust) * We also then don't have to have prelude run in the vm; that's good * We... maybe or maybe don't need processes in prelude, since we need to read and write from the boxes; we might be able to do that with closures and functions that call `spawn!` themselves @@ -1164,10 +1164,10 @@ That leaves the following list: * [x] completion - [ ] then js->rust->ludus * [x] kill - * [?] text input + * [x] text input * [ ] keypresses - - [ ] then ludus->rust->js->rust->ludus - * [ ] slurp + - [x] then ludus->rust->js->rust->ludus + * [x] slurp - For the above, I've started hammering out a situation. I ought to have followed my instinct here: do a little at a time. I ended up doing all the things in one place all at once. - What I've done is work on a bespoke `to_json` method for values; and using serde deserialization to read a string delivered from js. I think this is easier and more straightforward than using `wasm_bindgen`. Or easier; I have no idea what the plumbing looks like. - Just to catch myself up, some additional decisions & thoughts: diff --git a/pkg/ludus.js b/pkg/ludus.js index de045a1..542f62b 100644 --- a/pkg/ludus.js +++ b/pkg/ludus.js @@ -66,7 +66,7 @@ function io_poller () { } function start_io_polling () { - io_interval_id = setInterval(io_poller, 10) + io_interval_id = setInterval(io_poller, 100) } // runs a ludus script; does not return the result diff --git a/pkg/rudus_bg.wasm b/pkg/rudus_bg.wasm index 0820295..d3c9094 100644 Binary files a/pkg/rudus_bg.wasm and b/pkg/rudus_bg.wasm differ diff --git a/src/world.rs b/src/world.rs index 15a8379..630fbdd 100644 --- a/src/world.rs +++ b/src/world.rs @@ -426,7 +426,7 @@ impl World { } async fn maybe_do_io(&mut self) { - if self.last_io + 10.0 < now() { + if self.last_io + 100.0 < now() { let outbox = self.flush_buffers(); let inbox = do_io(outbox).await; self.fill_buffers(inbox);