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 (UPDATE) #56

Closed wenkokke closed 2 years ago

wenkokke commented 2 years ago

Version of #55 with minimal changes, updated after merge of #54:

tek commented 2 years ago

very nice.

maxbrunsfeld commented 2 years ago

FWIW, I spent a little time looking into why this patch is needed.

I'd really like to make the process of compiling parsers to WASM more foolproof. It's unfortunate that web-tree-sitter currently needs to decide how much of the C/C++ standard libraries to bundle; it seems to be a limitation of Emscripten's dynamic linking system that the "main module" needs to be the one to include the standard library. Maybe there's some alternative strategy though.

In the meantime, it seems like neither of these symbols in the patch is critical to the functionality of the scanner; it would probably be pretty straightforward to get it working with the existing web-tree-sitter.