Skip to content
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

Support for wasm target? #21

Open
rodrigopivi opened this issue Mar 31, 2018 · 2 comments
Open

Support for wasm target? #21

rodrigopivi opened this issue Mar 31, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@rodrigopivi
Copy link

Is there any intention to support wasm32-unknown-unknown target? I've tried to target web assembly but there are current old or deprecated dependencies that don't support wasm32 looking at the cargo tree. How hard would it be updating or replacing some of the dependencies that use libraries like time rustc-serialize memchr and support wasm?

@klefevre
Copy link
Contributor

klefevre commented Apr 3, 2018

Hello @rodrigopivi. Supporting wasm is something I'd like to bring and I think replacing these dependencies wouldn't be too hard but the main problem I had was with crfsuite-rs (https://github.com/snipsco/crfsuite-rs).

Because crfsuite-rs is just a binding of the C version of crfsuite. The steps to compile it are the following:

  • compile C code for a given target into a static library using the cc crate
  • convert header into rust code using bindgen

Which is basically what the crfsuite-sys crate does.

I successfuly compiled the static library for wasm32 target (at least I have an artefact), but I had a problem with bindgen to generate an API (no symbols were actually generated) which looks a lot like this issue rust-lang/rust-bindgen#751.
And even after hacking a bit this part (like trying to reuse a generated API from an other 32bit target). The linking part failed which could be whether the result of a bad compilation of the static library or something else I don't know.

In order word, I tried and I failed. But I have a strong feeling that is doable if we put enough time into it. And the first step to do so is to compile crfsuite-rs for wasm32 and any help are welcome on this! So feel free to open a PR if you have any idea on how to do it.

@klefevre klefevre added the enhancement New feature or request label Aug 16, 2018
@seanghay
Copy link

What about this https://github.com/seanghay/web-crfsuite 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants