You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've done some experiments as to understand whether we could run pytanque in Jupyter lite, and I think the answer is yes.
I'm opening this issue to document and coordinate such a possible endeavor.
There are two main TODOs to do, on the petanque side, and on the pytanque side:
petanque
For petanque, we need to:
create a petanque shell that can be compiled with js_of_ocaml. This is done already by Emilio, it is a very simple wrapper over the current shell, but using Worker's postMessage method instead of writing to stdout. I will submit a PR, and hopefully have coq-lsp CI to generate the .js file
have the JS version of petanque to use the coq-pkgs format from JSCoq to load the .vo files; this will require more work, but Emilio plans to do it
pytanque
For pytanque the main TODO is to make the constructor aware of pyodide , so instead of using TCP, it can talk to a web worker.
This seems easy enough, using latest pyodide release I was able to talk to the worker using pyodide.code.run_js and the following code:
varpetWorker=newWorker(petWorkerURL);
then petWorker.onmessage and petWorker.postMessage work fine (tested by Emilio).
Maybe the only question remaining is what is the most convenient way to have petWorker.onmessage push the answer to the Python side, but not a big deal IMHO.
some more comments
how much to automate the build?
wasm version works much better, but needs work for 8.20 as to adapt a stub, tho 8.19 could work, also we could try wasm_of_ocaml.
The text was updated successfully, but these errors were encountered:
Hi folks,
I've done some experiments as to understand whether we could run
pytanque
in Jupyter lite, and I think the answer is yes.I'm opening this issue to document and coordinate such a possible endeavor.
There are two main TODOs to do, on the
petanque
side, and on thepytanque
side:petanque
For
petanque
, we need to:postMessage
method instead of writing to stdout. I will submit a PR, and hopefully havecoq-lsp
CI to generate the .js filepetanque
to use thecoq-pkgs
format from JSCoq to load the .vo files; this will require more work, but Emilio plans to do itpytanque
For
pytanque
the main TODO is to make the constructor aware of pyodide , so instead of using TCP, it can talk to a web worker.This seems easy enough, using latest pyodide release I was able to talk to the worker using
pyodide.code.run_js
and the following code:then
petWorker.onmessage
andpetWorker.postMessage
work fine (tested by Emilio).Maybe the only question remaining is what is the most convenient way to have
petWorker.onmessage
push the answer to the Python side, but not a big deal IMHO.some more comments
The text was updated successfully, but these errors were encountered: