gf-core
gf-core copied to clipboard
Compile C runtime to Web Assembly using Emscripten
@krangelov has found out how to make the C runtime code compiling to JavaScript Web Assembly using Emscripten. The next step is to test if it works correctly and build some high-level bindings around them, hence this branch. This pull request is an extreme work-in-progress, but I'm creating it to act as the central thread for discussing this work.
Current status:
- I can read and show expressions
- Reading PGF files fails with the error which I'm stuck on:
pgf_read_tag_error (pgf/reader.c:103): assertion failed
Aborted(native code called abort())
/Users/john/repositories/GF/gf-core/src/runtime/javascript/.libs/pgf.js:148
throw ex;
^
RuntimeError: Aborted(native code called abort())
at abort (/Users/john/repositories/GF/gf-core/src/runtime/javascript/.libs/pgf.js:927:11)
at _abort (/Users/john/repositories/GF/gf-core/src/runtime/javascript/.libs/pgf.js:3709:7)
at wasm://wasm/00042f8e:wasm-function[80]:0x5b8c
at wasm://wasm/00042f8e:wasm-function[243]:0xef26
at wasm://wasm/00042f8e:wasm-function[241]:0xe8a9
at wasm://wasm/00042f8e:wasm-function[244]:0xefc4
at wasm://wasm/00042f8e:wasm-function[240]:0xe59e
at wasm://wasm/00042f8e:wasm-function[248]:0xf0c6
at Object._pgf_read (/Users/john/repositories/GF/gf-core/src/runtime/javascript/.libs/pgf.js:971:22)
at Object.readPGF (/Users/john/repositories/GF/gf-core/src/runtime/javascript/jspgf.js:44:28)
WASM uses it's own filesystem, and I am making sure to copy the PGF file into it first (when I don't I correctly get a file not found error). As far as I can tell the copying itself works, and I am stumped as to what could be the cause of this error.