context-free icon indicating copy to clipboard operation
context-free copied to clipboard

WebAssembly Port

Open azizghuloum opened this issue 1 year ago • 1 comments

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

Fixes #32

azizghuloum avatar Sep 26 '24 20:09 azizghuloum

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.

azizghuloum avatar Sep 26 '24 20:09 azizghuloum