diff --git a/assets/test_prelude.ld b/assets/test_prelude.ld index 83ad42f..186f1f5 100644 --- a/assets/test_prelude.ld +++ b/assets/test_prelude.ld @@ -1083,6 +1083,16 @@ fn heed! { } } +fn send_sync { + "Sends the message to the specified process, and waits for a response in the form of a `(:reply, response)` tuple." + (pid, msg) -> { + send (pid, msg) + receive { + (:reply, res) -> res + } + } +} + & TODO: make this more robust, to handle multiple pending requests w/o data races fn request_fetch! { (pid as :keyword, url as :string) -> { diff --git a/pkg/rudus_bg.wasm b/pkg/rudus_bg.wasm index 1b4a9ac..ee3a380 100644 --- a/pkg/rudus_bg.wasm +++ b/pkg/rudus_bg.wasm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e605d8a2c5a125dc5b386be2c7f6579c4fbfeeaa7c5a4296d30b87f1d081671 -size 16771299 +oid sha256:de73e134772464686f83ecc0389fb8661f8946f705edeb896cc493578814356e +size 16770813 diff --git a/src/lib.rs b/src/lib.rs index e063d0b..caf2538 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,14 +5,10 @@ use std::rc::Rc; use std::cell::RefCell; const DEBUG_SCRIPT_COMPILE: bool = false; -const DEBUG_SCRIPT_RUN: bool = true; +const DEBUG_SCRIPT_RUN: bool = false; const DEBUG_PRELUDE_COMPILE: bool = false; const DEBUG_PRELUDE_RUN: bool = false; -// #[cfg(target_family = "wasm")] -// #[global_allocator] -// static ALLOCATOR: talc::TalckWasm = unsafe { talc::TalckWasm::new_global() }; - mod io; use io::send_err_to_ludus_console; @@ -40,7 +36,6 @@ mod errors; use crate::errors::{lexing, parsing, validation}; mod panic; -mod keywords; mod js; use crate::js::*;