Hacker News new | past | comments | ask | show | jobs | submit login

Hi, I've been using Rust to WebAssembly very recently for a toy project [0] and posted about it very recently on HN [1].

So my answers:

1. I'm using both wasm and asm.js (installed using rustup) and it works for me extremely well, no weird bugs, very easy to set up.

However I'm really missing a way to pass arguments to the linker, like "-s BINARYEN_METHOD='asmjs,native-wasm'" or "-s EMCC_DEBUG=1" or "-s DETERMINISTIC=1" or "-s SIMD=1" or "SIDE_MODULE=1"

I think there is already a bug opened for this but I'm not able to find it on Google right now.

From crate.io, I'm missing a N-dimensional array library (BLAS/LAPACK like) that compile to webassembly. There is ndarray[3], but its available BLAS dependencies are using fortran and therefore not compilable to wasm. Maybe thoses projects could help: emlapack[4], weblas[5]

Also, I know it would be difficult to implement and would need some kind of better interaction with emscripten, but anything that makes it easier to pass and convert/cast object/arguments to and from javascript would be welcome. Right now, it requires a lot of boilerplate and unsafe code, mostly with structs [6].

2. I'm using it and considers using it more, I love it, thank a lot to everyone working on it!

3. Right now I'm deep into deep learning and I'm thinking about writting an implementation in Rust (that's why it would be nice to have a BLAS/LAPACK library). It could then be used on the Tensorflow playground[6] to showcase the technology.

[0] https://buddhabrot.paulg.fr

[1] https://news.ycombinator.com/item?id=15491781

[3] https://crates.io/crates/ndarray

[4] https://github.com/likr/emlapack

[5] https://www.npmjs.com/package/weblas

[6] https://github.com/PaulGrandperrin/rustybrot-web/blob/master...

[7] http://playground.tensorflow.org




> but anything that makes it easier to pass and convert/cast object/arguments to and from javascript would be welcome.

Perhaps this crate would be of some use to you?

https://github.com/koute/stdweb


Thanks, I'll check that out!


    #![feature(link_args)]
    #[cfg_attr(target_arch="wasm32", link_args = "\
        -s TOTAL_MEMORY=268435456 \
        -s NO_EXIT_RUNTIME=1 \
    ")]
    extern {}


That's a really nice project. Well done, I feel inspired to rewrite my old Mandlebrot.js implementation now.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: