Skip to content
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

Support hosting WebAssembly demo page locally #413

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

ChinYikMing
Copy link
Collaborator

To enhance the user experience of using WebAssembly version of rv32emu, we shall provide a Makefile target (serve-wasm) to serve the WebAssembly demo page in an easy way.

Since rv32emu leverages TCO (tail call optimization) when being compiled, so we have to tell if the user's browser supports TCO. Currently, only Chrome with MAJOR 112 and Firefox with MAJOR 121 supports TCO execution runtime, thus we focus on this two browsers. Also, use color text to remind the users if they need to update their Chrome or Firefox.

See also: #75

mk/color.mk Outdated Show resolved Hide resolved
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Move WebAssembly related rules to mk/wasm.mk.

@ChinYikMing
Copy link
Collaborator Author

ChinYikMing commented Apr 8, 2024

Run make CC=emcc start-web to test it.

Note that you should install emcc then source your emcc firstly. In macOS or Linux, use source ~/emsdk/emsdk_env.sh.

@ChinYikMing
Copy link
Collaborator Author

Move WebAssembly related rules to mk/wasm.mk.

Done.

@ChinYikMing
Copy link
Collaborator Author

ChinYikMing commented Apr 8, 2024

README will be updated on future PR.

mk/wasm.mk Outdated Show resolved Hide resolved
@ChinYikMing ChinYikMing force-pushed the serve-wasm branch 4 times, most recently from eb750cc to 50e9b74 Compare April 8, 2024 17:15
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Update README.md to reflect the proposed changes.

To enhance the user experience of using WebAssembly version of rv32emu,
we shall provide a Makefile target (serve-wasm) to serve the WebAssembly
demo page in an easy way.

Since rv32emu leverages TCO (tail call optimization) when being compiled,
so we have to tell if the user's browser supports TCO. Currently, only
Chrome with MAJOR 112 and Firefox with MAJOR 121 supports TCO execution
runtime, thus we focus on this two browsers. Also, use color text to
remind the users if they need to update their Chrome or Firefox.

See also: sysprog21#75
mk/external.mk should comes before mk/wasm.mk since mk/wasm.mk depends
on targets which defined in mk/external.mk to fetch externals.
@ChinYikMing
Copy link
Collaborator Author

Update README.md to reflect the proposed changes.

Done.

README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ChinYikMing ChinYikMing force-pushed the serve-wasm branch 3 times, most recently from c59edde to f9e95e3 Compare April 9, 2024 05:38
@jserv jserv merged commit 9ea1e62 into sysprog21:master Apr 9, 2024
8 checks passed
@jserv
Copy link
Contributor

jserv commented Apr 9, 2024

Thank @ChinYikMing for contributing!

@ChinYikMing ChinYikMing deleted the serve-wasm branch April 9, 2024 06:28
vestata pushed a commit to vestata/rv32emu that referenced this pull request Jan 24, 2025
Support hosting WebAssembly demo page locally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants