Message-based host boundary
Host and runtime exchange JSON over `qz_post_message` / `message_cb`. Inbound is thread-safe; outbound fires on the runtime thread. No `eval`, no `tick`.
Strict C99 · Low overhead · WinterTC standard runtime
# Clone with all submodules
git clone --recursive https://github.com/adam-ikari/qzjs.git
cd qzjs
# Configure and build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)#include <qzjs/qzjs.h>
#include <stdio.h>
static void on_message(qz_t *rt, const char *json, size_t len, void *data) {
(void)rt; (void)data;
printf("received: %.*s\n", (int)len, json);
}
int main(void) {
qz_config_t cfg = {0};
cfg.initial_script = "postMessage({hello: 'world'});";
cfg.message_cb = on_message;
qz_t *rt = qz_create(&cfg);
if (!rt) return 1;
qz_post_message(rt, "{\"cmd\":\"echo\",\"data\":\"hi\"}", 26);
qz_destroy(rt);
return 0;
}