6 ms·
And with wasm, Rust/C/C++ all can run in the browser too...
by bluejekyll 8y ago
And with wasm, Rust/C/C++ all can run in the browser too...
- zeth___ 8y agoNot quite yet. But getting there.
- bluejekyll 8y agopretty much there: https://www.hellorust.com/setup/wasm-target/ https://www.hellorust.com/setup/wasm-target/
- fineline 8y agoJS in the browser has direct integration to the DOM, networking, various local data persistence APIs, and other IO and sensors (webcam, accelerometer...) etc. Rust can be compiled to run in a sandbox, which can then be integrated via a remote call interface with the JS layer, and thus be indirectly (via JS) connected to the above APIs, but there are currently concerns around the performance of this approach. Rust cannot independently manage a web page which hosts it, without JS. There is some way to go before browsers support practical, accessible and performant front-end web apps in Rust.
- erikpukinskis 8y agoWhen people say “The Browser” they mean “that thing which is on literally every computer where you instantly load that one kind of software”. People think the web is a technology, or that JavaScript is a language. They’re not. It’s not. The web is an idea: it’s the idea that every computer in the world already has the runtime on it that can run your next app. Whatever that is—whatever that runtime is—that’s “The Browser”. WASM is not that. Maybe in 10 years.
- somenewacc 8y agoemscripten can compile to both wasm and asm.js and load them depending on browser support. this seems good enough.
- erikpukinskis 8y agoPerformance won’t be as good as hand tuned JavaScript with native DOM calls.
- abiox 8y agowebassembly has vastly improved performance in a variety of situations.
- nulagrithom 8y agoWhat are you babbling about? The web is technology. JavaScript is a language. And WASM is shipping in all major browsers already. You don't have to wait 10 years. You can start using WASM today.
- erikpukinskis 8y agoIt hurts my feelings that you think I’m babbling. I’m trying to be as articulate as I can. I don’t want to write software just for people with 2 year old iPhones. I write software for everyone, especially people who can’t afford anything but the hardware they’re stuck with. That’s why I’m not going to target WASM. That’s my point: to me, “The Web” isn’t just modern browsers on newish devices. It’s the whole world as an audience. I think that’s why so many people target the web. I also think WASM is premature optimization in almost all situations. That said, I totally support anyone who wants to target it. It’s dope technology. If you love Rust and you want to write browser apps with it, and limit your audience a little, knock yourself out. I don’t think you’re embracing what the web is for, but there’s no law that says you have to.
- abiox 8y agoafaik webassembly has shipped in all major browsers - edge, firefox, opera, chrome and safari... including mobile versions.
- erikpukinskis 8y agoIf your audience can exclude the very poor and people with extreme bandwidth limitations ( for updating OS, etc), or you can afford to just tell people “no” then that’s certainly a decision you can make. But you’ll be saying no to a lot of people.
- abiox 8y agoi'm sorry but i don't quite follow what you're trying to say.
- erikpukinskis 8y agoI’m getting a lot of pushback in this thread so I’ll put this in the “maybe I’m wrong bucket”. I’ll wait to talk about it again until after I have experience doing browser compatiblility testing with a WASM toolchain.