-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raw C usage (or in Go via Cgo) #147
Comments
It should be possible to get this project building for native C quite easily yes. That said, since it wasn't designed for this, it likely would have vulnerabilities outside of being used in a Wasm sandbox. There is also a Rust build at https://github.com/jspm/rust-lexer which may be easier to run in Go. Another alternative might even be to use the component build at #143 which builds a WebAssembly component which could be used in Go while retaining strong security. These Wasm directions are very experimental though so it would only be if you're interested in exploring that. |
Hi, thanks for the response The Rust build looks promising, although I can't find it (perhaps it's a private repo?). I thought about using WASM but that looks like it would be fairly complex to run. I'm willing to explore different routes - it's not a high priority, I have the functionality via EsBuild but this would be preferable. What's the experimental part with Wasm? |
Ah, ok I've given you access to the Rust lexer. Note it's behind this main branch by quite a bit now, although in theory the upstreaming shouldn't be too tricky. Open to collaboration on that repo. Also happy to share more about Wasm workflows too. |
I'd be really interested in the Rust lexer as well (or other documentation on how to use the wasm module in rust). I was trying to get the lexer to run in Rust, but I was having a hard time using both wasmtime and cc, and can't seem to get things up and running. |
Also found this today: https://github.com/devongovett/es-module-lexer/blob/main/src/lib.rs for anybody else who's reading along |
The Rust version worked on previously in collaboration with @vovacodes is at https://github.com/jspm/rust-lexer. It hasn't been updated in over two years to the current es-module-lexer commits though. |
Hi,
I don't have experience with wasm (or C for that matter) but I'm wondering how difficult this would be to get working in C (and eventually Go)? Would it be a few small changes, or is it entirely designed for wasm as a target and would require significant work?
End goal would be to parse JS strings with this in a Go cli.
Cheers
The text was updated successfully, but these errors were encountered: