I'm trying to figure out how to solve some nontrivial nonlinear equations within WebPPL. I found Ceres.js, but its initialization runs asynchronously, which gives me a headache since I can't use `await` within WebPPL... Even if I enforce a long sleep via
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 100000);
the Ceres module initialization promise still hasn't resolved.
Is there any way to deal with promises returned by js functions within WebPPL? Or do you know of any other solver that runs synchronously?