From my understanding, Jaspy requires a custom server because server.py handles GET requests to /load/ specially by asking compile_and_convert() from convert.py to compile it to bytecode, and then sending back the result.
However, my goal is to make a Python REPL available directly in the browser. So far, I have found either libraries that send the instructions back to a server for execution, or libraries that do not support interruptions of execution (input()).
WIth the VM interpreter, Jaspy seems like it should be able to do the trick. However, there remains the issue of compiling to bytecode. Considering that Jaspy is written in Python, compiling Jaspy itself to Javacript may be doable (of course, a few adaptations for I/O could be necessary).
So, I have a few questions:
- what do you think of a fully client-sided interpreter?
- do you plan to make Jaspy compatible with this?
- do you plan to implement that yourself / have you started working on it?
- do you have any pointers if I (or anyone) do start working on this?
Edit: I have just realized that Jaspy just relies on compile() to generate the bytecode. I will leave the issue there in case it is of interest.
From my understanding, Jaspy requires a custom server because
server.pyhandles GET requests to/load/specially by askingcompile_and_convert()fromconvert.pyto compile it to bytecode, and then sending back the result.However, my goal is to make a Python REPL available directly in the browser. So far, I have found either libraries that send the instructions back to a server for execution, or libraries that do not support interruptions of execution (
input()).WIth the VM interpreter, Jaspy seems like it should be able to do the trick. However, there remains the issue of compiling to bytecode. Considering that Jaspy is written in Python, compiling Jaspy itself to Javacript may be doable (of course, a few adaptations for I/O could be necessary).
So, I have a few questions:
Edit: I have just realized that Jaspy just relies on
compile()to generate the bytecode. I will leave the issue there in case it is of interest.