Skip to content

gh-136251: Improvements to WASM demo REPL #136252

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

Merged
merged 23 commits into from
Jul 21, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
af4aa0d
EMSCRIPTEN BUILD: export HEAPU32 from emscripten build so that python…
adqm Jul 2, 2025
394815e
WASM REPL: fix loading xterm.js (broken in 2f1cee8477)
adqm Jul 2, 2025
aab9ccc
WASM REPL: basic navigation in REPL (arrow keys, home/end, etc)
adqm Jul 2, 2025
bd52abe
WASM REPL: reset the python worker after a program exits so that we c…
adqm Jul 2, 2025
77cc952
WASM REPL: handle a few more special keys (tab, ctrl+c)
adqm Jul 2, 2025
4cfa3f1
WASM REPL: use ace editor instead of a plain textbox for code snippet
adqm Jul 2, 2025
b688663
WASM REPL: some organization, refactoring, fixes for history
adqm Jul 2, 2025
43a47dc
WASM REPL: put demo at index.html and change text of the 'Run Code' b…
adqm Jul 3, 2025
6d5f698
WASM REPL: update README.md to account for demo location moving
adqm Jul 3, 2025
16cfea2
WASM REPL: add HEAPU32 to exports in configure.ac
adqm Jul 3, 2025
faf2ba4
WASM REPL: fix for ACE setup in Chromium
adqm Jul 3, 2025
70d4a17
WASM REPL: run prettier on index.html
adqm Jul 3, 2025
ce5ebca
WASM REPL: lower-case 'code' on 'Run code' button
adqm Jul 3, 2025
66cf49d
WASM REPL: remove trailing slashes from void tags in index.html
adqm Jul 5, 2025
8fe92d6
add short news blurb
adqm Jul 5, 2025
25fd7fc
change text of news blurb
adqm Jul 16, 2025
9a26d70
WASM REPL: better implementation of ctrl+c behavior
adqm Jul 16, 2025
c477e30
WASM REPL: show error message when SharedArrayBuffer is not available
adqm Jul 16, 2025
4dcc6fb
WASM REPL: maintain history during browsing session
adqm Jul 16, 2025
e06a7b2
WASM REPL: make the magic ctrl+c string vary with each run
adqm Jul 17, 2025
3e76313
Merge branch 'main' into wasm_repl
hoodmane Jul 21, 2025
26ddd07
Fix emscripten in browser
hoodmane Jul 21, 2025
7d33525
Merge branch 'main' into wasm_repl
hoodmane Jul 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WASM REPL: add HEAPU32 to exports in configure.ac
  • Loading branch information
adqm committed Jul 3, 2025
commit 16cfea22b3fd62427de65d16146c912e815630b3
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,7 @@ AS_CASE([$ac_sys_system],

dnl Include file system support
AS_VAR_APPEND([LINKFORSHARED], [" -sFORCE_FILESYSTEM -lidbfs.js -lnodefs.js -lproxyfs.js -lworkerfs.js"])
AS_VAR_APPEND([LINKFORSHARED], [" -sEXPORTED_RUNTIME_METHODS=FS,callMain,ENV"])
AS_VAR_APPEND([LINKFORSHARED], [" -sEXPORTED_RUNTIME_METHODS=FS,callMain,ENV,HEAPU32"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide more information? I made this change since python.worker.mjs is currently trying to look in HEAPU32 to find Python's version info but it wasn't accessible (in my original builds, I just manually edited python.worker.mjs to hard-code the version number to make things work).

I'm guessing from "Oops," though, that this isn't the right way to fix this? First time messing with Emscripten/WASM at all, so if you don't mind, more context would be appreciated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hoodmane The "oops" comment is ambiguous to me as well - just to confirm, this is an "oops, HEAPU32 should definitely be included, how did I miss that?", rather than or "oops, this shouldn't be included"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry for the unclear communication. Change is correct.

this is an "oops, HEAPU32 should definitely be included, how did I miss that?"

Exactly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the confusion; I definitely initially interpreted it the other way 😅 But glad to know I wasn't making a stupid mistake!

AS_VAR_APPEND([LINKFORSHARED], [" -sEXPORTED_FUNCTIONS=_main,_Py_Version,__PyRuntime,__PyEM_EMSCRIPTEN_COUNT_ARGS_OFFSET,_PyGILState_GetThisThreadState,__Py_DumpTraceback"])
AS_VAR_APPEND([LINKFORSHARED], [" -sSTACK_SIZE=5MB"])

Expand Down
Loading