News for hackers. Stuff that matters.
Re:Perspective: Streaming pivot visualization via WebAssembly by Klathmon on Tuesday February 06, 2018 @12:03PM (#16317565)
Even outside of C/C++, Emscripten seems to be required in some fashion for just about every "compile X to webasm". Which i'm not that happy about as it's quite heavy and takes a long time to compile, which makes it harder for newcomers to try it out because it requires a fairly large time investment to even compile hello world.
Re:Perspective: Streaming pivot visualization via WebAssembly by ekidd on Tuesday February 06, 2018 @12:07PM (#16317601)
> Even outside of C/C++, Emscripten seems to be required in some fashion for just about every "compile X to webasm".

One exception to this is Rust's new "wasm32-unknown-unknown" target, which uses LLVM to directly generate wasm files without going through emscripten: https://www.hellorust.com/news/native-wasm-target.html

The easiest way to use it for larger projects is probably via https://github.com/koute/cargo-web, which handles a lot of packaging very nicely.

It's really nice to use, assuming you already know Rust.

Re:Perspective: Streaming pivot visualization via WebAssembly by Klathmon on Tuesday February 06, 2018 @01:01PM (#16318021)
Yeah I'm super excited about Rust's new webasm compiler, as well as some new-ish stuff with .Net that works without Emscripten.

I get the ecosystem is super young, but it was honestly what kept me from playing with Webasm for a while, because each time I'd sit down to play with it I'd be in for a 3 hour compile after spending an hour getting my windows machine to have the right compilers and not stomping over other things I have setup on here.

Re:Perspective: Streaming pivot visualization via WebAssembly by azakai on Tuesday February 06, 2018 @04:57PM (#16320270)
Sounds like you were seeing an old emscripten SDK bug, where it compiled LLVM+clang unnecessarily and with debug info (which is very slow).

Currently there shouldn't be anything like that, it will download a binary build of LLVM+clang for your system. It should be ready to use immediately after that download.

Re:Perspective: Streaming pivot visualization via WebAssembly by bbatha on Tuesday February 06, 2018 @12:06PM (#16317587)
Rust’s wasm32-unknown-unknown target does not use emscripten at all. The tool cargo-web will handle the js module shims for you.
Re:Perspective: Streaming pivot visualization via WebAssembly by Game_Ender on Tuesday February 06, 2018 @02:00PM (#16318536)
cargo-web uses emscripten under the hood.
Re:Perspective: Streaming pivot visualization via WebAssembly by a_humean on Tuesday February 06, 2018 @02:33PM (#16318826)
No, he is right. cargo-web supports three backends, of which only two include emscripten and the third using a native rust backend. https://github.com/koute/cargo-web#features

Rust can be compiled to wasm without emscripten using wasm32-unknown-unknown.

Re:Perspective: Streaming pivot visualization via WebAssembly by bringtheaction on Tuesday February 06, 2018 @05:45PM (#16320648)
Does that mean I can install cargo-web without emscripten or do I still need it even though I am not going to use it just because the two other targets use it? In other words, is emscripten an optional or a hard dependency?
Re:Perspective: Streaming pivot visualization via WebAssembly by a_humean on Wednesday February 07, 2018 @08:13AM (#16324128)
Its an optional dependency. You can build without it by just using a nightly version of rust with the wasm32-unknown-unknown backend.

An example of using cargo-web with the stdweb rust project: https://github.com/koute/stdweb#running-the-examples