tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
155 stars 36 forks source link

Compile to wasm with patch to web-tree-sitter #55

Closed wenkokke closed 2 years ago

wenkokke commented 2 years ago

This PR enables compilation of tree-sitter-haskell to wasm, provided that web-tree-sitter has been patched with this patch.

It does not update the build via node-gyp, and hence does not update binding.gyp to set the correct C++ version, as unfortunately I don't think this would work, given that in emscripten, the honus is on the MAIN_MODULE to export the required standard library functions.

I understand that this PR is far from ideal, but it does provide a temporary fix for #53.

tek commented 2 years ago

this would also be fixed by removing the dependency on c++14, right?

maxbrunsfeld commented 2 years ago

Looking at the patch, it seems like the additional symbols are related to C++'s reflection/runtime-type-information features. I'm not sure why those are getting used by the current external scanner; maybe the use of std::function involves some type of runtime type reflection? So maybe the current work that @414owen is doing in #54 will help with this problem.

wenkokke commented 2 years ago

@tek would you be happy to merge the expansion of parse-examples to web assembly tests as a separate pull request, if @414owen’s rewrite ends up fixing the problem as well?

tek commented 2 years ago

sure!