> Tom Tromey and I have replaced the most performance-sensitive portions of the source-map JavaScript Library’s source map parser with Rust code that is compiled to WebAssembly. The WebAssembly is up to 5.89 times faster than the JavaScript implementation on realistic benchmarks operating on real world source maps. Wow. Some people have been wondering if Rust has a "killer app", but this could be it. Right now WebAss…
Why do you say Rust is easier to start with than C or C++? [Disclaimer : i'm old enough to dream in K&R C and later ANSI C, and then C++, but am more than enthused about Rust, so a genuine question]
Oxidizing Source Maps with Rust and WebAssembly
11–20 of 32 posts
Re: Oxidizing Source Maps with Rust and WebAssembly
#12> Tom Tromey and I have replaced the most performance-sensitive portions of the source-map JavaScript Library’s source map parser with Rust code that is compiled to WebAssembly. The WebAssembly is up to 5.89 times faster than the JavaScript implementation on realistic benchmarks operating on real world source maps. Wow. Some people have been wondering if Rust has a "killer app", but this could be it. Right now WebAss…
Why do you say Rust is easier to start with than C or C++? [Disclaimer : i'm old enough to dream in K&R C and later ANSI C, and then C++, but am more than enthused about Rust, so a genuine question]
Re: Oxidizing Source Maps with Rust and WebAssembly
#13Earlier quoted context omitted.
Why do you say Rust is easier to start with than C or C++? [Disclaimer : i'm old enough to dream in K&R C and later ANSI C, and then C++, but am more than enthused about Rust, so a genuine question]
Perhaps he means the tooling for using emscripten with rust is superior, and easier to get set-up? (i'm not actually sure if it is, i've never tried it). I'm really excited about the future of rust and have really enjoyed writing a raytracer in it, but I don't see how it's an easier-to-use language than C or C++. Easier to write safe code in sure, but not easier to pick up for a newbie.
emscripten is no longer required for Rust to target WASM. There is a new target of wasm32-unknown-unknown. This project gives you quick bootstrap instructions into WASM with Rust:
https://github.com/koute/stdweb
Very quick to get started with, and the examples get you going quickly. I just used it yesterday (nothing fancy), and everything worked right out of the box.
Re: Oxidizing Source Maps with Rust and WebAssembly
#14Earlier quoted context omitted.
Perhaps he means the tooling for using emscripten with rust is superior, and easier to get set-up? (i'm not actually sure if it is, i've never tried it). I'm really excited about the future of rust and have really enjoyed writing a raytracer in it, but I don't see how it's an easier-to-use language than C or C++. Easier to write safe code in sure, but not easier to pick up for a newbie.
> the tooling for using emscripten with rust is superior emscripten is no longer required for Rust to target WASM. There is a new target of wasm32-unknown-unknown. This project gives you quick bootstrap instructions into WASM with Rust: https://github.com/koute/stdweb Very quick to get started with, and the examples get you going quickly. I just used it yesterday (nothing fancy), and everything worked right out of th…
Re: Oxidizing Source Maps with Rust and WebAssembly
#15Re: Oxidizing Source Maps with Rust and WebAssembly
#16 Vec::::from_raw_parts(capacity_ptr, size, capacity);
But size is wrong. size here is the number of bytes that JavaScript instructed Rust to allocate. It's not the size of the Vec::.This should be harmless as the resulting Vec is immediately deallocated, so the only thing that size is used for is deinitializing values, and since the values are usize there's nothing to deinitialize. But it's still technically incorrect.
Re: Oxidizing Source Maps with Rust and WebAssembly
#17Re: Oxidizing Source Maps with Rust and WebAssembly
#18Earlier quoted context omitted.
Why do you say Rust is easier to start with than C or C++? [Disclaimer : i'm old enough to dream in K&R C and later ANSI C, and then C++, but am more than enthused about Rust, so a genuine question]
I would guess that a language in where the compiler holds your hand so you don't shoot yourself in the foot is probably by definition a bit easier than one that hides traps for you behind corner every now and then :)
C is so small a language that you can learn it much quicker. The problems surface later on.
Re: Oxidizing Source Maps with Rust and WebAssembly
#19Earlier quoted context omitted.
I would guess that a language in where the compiler holds your hand so you don't shoot yourself in the foot is probably by definition a bit easier than one that hides traps for you behind corner every now and then :)
While I generally agree with that sentiment, Rust's compiler is so hard to please that a lot of C/C++ developers find it hard to do it. I think for a beginner it's even harder. C is so small a language that you can learn it much quicker. The problems surface later on.
Unless what you are doing is not fit for what guarantees Rust gives you, the compiler should just be a crutch in case you missed a step.
Re: Oxidizing Source Maps with Rust and WebAssembly
#20Earlier quoted context omitted.
I would guess that a language in where the compiler holds your hand so you don't shoot yourself in the foot is probably by definition a bit easier than one that hides traps for you behind corner every now and then :)
While I generally agree with that sentiment, Rust's compiler is so hard to please that a lot of C/C++ developers find it hard to do it. I think for a beginner it's even harder. C is so small a language that you can learn it much quicker. The problems surface later on.
I think it's hard for those who carry "mindset-baggage" from C/C++. My first attempt at Rust was a failure mostly because I thought it was sort of a "weird C/C++".