News for hackers. Stuff that matters.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by ModernMech on Thursday June 02, 2022 @10:25PM (#31603518)
I do it because the toolchain is so nice. I just do

  wasm-pack build --target web
And it builds a little wasm file and some js shim, and that's all it takes to get a Rust website up and running.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by gspr on Friday June 03, 2022 @04:11AM (#31605588)
I find that part a hurdle, actually, despite loving Rust. I'm struggling with magic tools like wasm-pack that take over the build process. Cargo is fine – I know what Cargo does and how and why it calls rustc. But finding out what wasm-pack and friends do has been an uphill battle for me.

Why can't I just compile to wasm32 with Cargo? What's missing?

Re:Rust Is Hard, Or: The Misery of Mainstream Programming by ModernMech on Friday June 03, 2022 @10:54AM (#31609136)
As far as I know you can using the wasm32-unknown-unknown target. I think wasm-pack does extra stuff like supporting different targets like a nodejs module or a webpack compatible format, which is outside of the scope of something like cargo imo.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by gspr on Friday June 03, 2022 @11:52AM (#31610002)
But what is that "extra stuff" that it does?