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

WebAssembly Port #45

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

WebAssembly Port #45

wants to merge 10 commits into from

Conversation

azizghuloum
Copy link

@azizghuloum azizghuloum commented Sep 26, 2024

Build instructions are in Wasm.Dockerfile and are documented in README. Please let me know if you need something fixed.

Fixes #32

@azizghuloum
Copy link
Author

There are two issues with the wasm build worth mentioning:

  1. Unicode nfkc normalization is skipped because I couldn't figure out how to do it. It doesn't seem to affect the included tests and maybe the cfdg files just need to be normalized in the browser/whatever before rendering.
  2. The main function cannot be called twice to process a second file. I think some globals get initialized properly in the first run but their state remains in memory and would be invalid for a second run. When I use cfdg in the browser, I load it in a "one-shot" web worker where input file is set up, main() is called, then the output file is sent back to the browser. It works and is unnoticeable, but kinda wasteful. It would be nice to be able to call main() repeatedly but I understand it was not designed for that.

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.

Compiling to WASM?
1 participant