Skip to content

Improved usability of WASM web REPL for testing/development. #97747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
katharosada opened this issue Oct 3, 2022 · 2 comments
Closed

Improved usability of WASM web REPL for testing/development. #97747

katharosada opened this issue Oct 3, 2022 · 2 comments
Labels
OS-wasi type-feature A feature request or enhancement

Comments

@katharosada
Copy link
Contributor

katharosada commented Oct 3, 2022

Feature or enhancement

There's a demo python WASM REPL included in cpython for development and testing purposes.

It has the following issues:

  • It's currently impossible to 'stop' the python process - an infinite loop means you have to close the browser tab.
  • The 'Start REPL' button can be pressed multiple times while the program is running, this does not work as expected. It queues another REPL to start as soon as the current REPL exits.
  • Working in the REPL for testing is painful - especially since it's a limited REPL implementation, e.g. no up-arrow to repeat previous commands.

Example here: https://repl.ethanhs.me/

Pitch

I propose adding the following to the REPL:

  • A stop button that kills the webworker process (effectively terminating the python process)
  • Disabling the start button while there is an active python process running.
  • Adding a text area for python code so that code can be edited and executed multiple times.

Previous discussion

Linked PRs

@katharosada katharosada added the type-feature A feature request or enhancement label Oct 3, 2022
@katharosada katharosada changed the title Improved usability of WASM web REPL for testing/development. gh-97747: Improved usability of WASM web REPL for testing/development. Oct 3, 2022
@katharosada katharosada changed the title gh-97747: Improved usability of WASM web REPL for testing/development. Improved usability of WASM web REPL for testing/development. Oct 3, 2022
@brettcannon
Copy link
Member

@katharosada Did you want me to leave this open to target this for WASI, or should I close this?

ambv pushed a commit that referenced this issue May 31, 2024
Improvements to WASM browser REPL.

Adds a text box to write and run code outside the REPL, a stop button, and handling of Ctrl-D for EOF.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 31, 2024
Improvements to WASM browser REPL.

Adds a text box to write and run code outside the REPL, a stop button, and handling of Ctrl-D for EOF.
(cherry picked from commit 010aaa3)

Co-authored-by: Katie Bell <[email protected]>
ambv pushed a commit that referenced this issue May 31, 2024
@hugovk
Copy link
Member

hugovk commented Jun 15, 2024

@katharosada Did you want me to leave this open to target this for WASI, or should I close this?

No reply in four months, let's close. We can always re-open.

@hugovk hugovk closed this as completed Jun 15, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
Improvements to WASM browser REPL.

Adds a text box to write and run code outside the REPL, a stop button, and handling of Ctrl-D for EOF.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Improvements to WASM browser REPL.

Adds a text box to write and run code outside the REPL, a stop button, and handling of Ctrl-D for EOF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-wasi type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants