Skip to content

WebAssembly Port#45

Open
azizghuloum wants to merge 10 commits intoMtnViewJohn:masterfrom
azizghuloum:wasm
Open

WebAssembly Port#45
azizghuloum wants to merge 10 commits intoMtnViewJohn:masterfrom
azizghuloum:wasm

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