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

WASM #1

Open
jpeddicord opened this issue Jan 18, 2018 · 4 comments
Open

WASM #1

jpeddicord opened this issue Jan 18, 2018 · 4 comments

Comments

@jpeddicord
Copy link
Owner

jpeddicord commented Jan 18, 2018

Yes, really. Not so much for use in a browser, but to make use in Node less painful.

Alternatives to that root problem:

  • Use neon, a cool project in its own right
  • Write C-style bindings

Neither are huge upfront cost, but are a maintenance load and are more difficult to use downstream.

...also I think it'd be really neat to have an in-browser demo of this library.

@jpeddicord
Copy link
Owner Author

Thought dump:

  • wasm32-unknown-unknown is not a great goal for now; there's too many dependencies that can't work withough e.g. libc at the moment
  • emscripten seems OK. more work to bootstrap, but using emsdk wasn't too bad, and everything builds successfully.
  • will still probably omit filesystem-related things during wasm compile, though.

@jpeddicord
Copy link
Owner Author

Progress made here! There's some stuff in the wasm directory in master. It's very basic and not at all supported, but I'm hoping to iterate quickly as some more dependencies become wasm-capable.

@dattanchu
Copy link

dattanchu commented Feb 4, 2020

After installing apt packages clang, and gcc-multilib, I am now stuck on an error when rust try to compile zstd-sys error: unable to create target: 'No available targets are compatible with this triple.'

You mentioned that you were able to use emscripten to build a wasm binding for this library. Can you give more information please?

@jpeddicord
Copy link
Owner Author

I've in fact been running into this issue myself; it's been a while since I got this to work out successfully. If I recall correctly, the options were to use emsdk to build with emscripten (which doesn't really fix the wasm32 target here) or to build LLVM yourself with the wasm32 stdlib enabled. The packages on Ubuntu don't ship with that; the packages on Arch might. I do want to dig into this more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants