News for hackers. Stuff that matters.
Re:Building a web application with Rust and WebAssembly by paulgb on Wednesday June 15, 2022 @08:29PM (#31761180)
As someone who uses Rust as my main language, part of the appeal of Rust+yew is “no webpack”. Rust’s build system isn’t necessarily less complex, but it doesn’t drive me batty the way JS compilation does.
Re:Building a web application with Rust and WebAssembly by ducharmdev on Wednesday June 15, 2022 @08:40PM (#31761249)
I'd recommend you give Vite a try, imo it's a painless replacement for webpack.
Re:Building a web application with Rust and WebAssembly by torstenvl on Wednesday June 15, 2022 @08:40PM (#31761252)
Webpack? JS compilation?

I don't know what either of those things are and I don't know why you'd use them instead of plain HTML and CGI (maybe FastCGI or mod_php if you really want to get fancy).

I think what GP is asking is: for those of us who don't follow the latest web development trends, what's the inherent value to this? it isn't clear to an outsider what distinguishes this from just the latest fad?

EDIT: I see that webpack is a tool to simplify bundling of JS modules and dependencies in large scale JS projects

Re:Building a web application with Rust and WebAssembly by e63f67dd-065b on Wednesday June 15, 2022 @08:57PM (#31761382)
- Transpilers: sometimes you need to support old browser versions but want to use newer features

- Typescript: one but lesson we’ve learnt over the years is that vanilla JS sucks and when your codebase grows into the >10k loc range it becomes a nightmare without engineering and tools like the typescript compiler

- minification: minify your JS, HTML, and CSS

- state synchronisation: a big problem with the jquery days was desync, modern web frameworks make it very easy for state and ui to stay in sync

- one codebase for web, electron (desktop), mobile (react native). Whether this is a good or bad thing is left as an exercise to the reader

- lots more I’m forgetting. For better or for worse, that’s the modern JS toolchain, plain HTML with some JS sprinkled on top just doesn’t cut it for modern webapps anymore

Re:Building a web application with Rust and WebAssembly by torstenvl on Wednesday June 15, 2022 @09:06PM (#31761456)
I don't follow. Which older browsers? If they're new enough to support WASM, but this development method is so brittle that they already need transpiling to support them, that's a red flag. On the other hand, if you're talking about pre-WASM browsers, I don't understand how Rust + WASM is going to help support them.
Re:Building a web application with Rust and WebAssembly by e63f67dd-065b on Wednesday June 15, 2022 @10:10PM (#31761819)
Sorry, I was just responding to your question on JS compilation and webpack.

This post is obviously overengineering things, it’s literally submitting a html form and obviously we can do that with plain old html. The point, however, is that it’s a small scale demonstration of how to run rust on the web, not that you should make phishing websites out of rust and wasm.

Are there actual use cases for wasm? Yes, particularly for performance critical applications. Games, ML, etc, there’s already a lot of wasm deployed today. Since wasm is here to stay, the natural follow-up question is can we compile to it so I can use <insert favourite language> on the web, and that’s the motivation behind stuff like rust/wasm.

NodeJS made it possible to run JS on both front and backend, but nobody actually wants to write JS. So now people are trying to run <favourite nonJS language> on both instead. It’s still in its infancy, so really not recommended for anything other than prototyping and fun exploration, but there’s potential here.

Re:Building a web application with Rust and WebAssembly by torstenvl on Wednesday June 15, 2022 @10:49PM (#31762022)
Thanks! That's really helpful.
Re:Building a web application with Rust and WebAssembly by mrits on Wednesday June 15, 2022 @09:17PM (#31761515)
It sounds like you have almost no knowledge of the ecosystem. I wonder why you feel it is appropriate to criticize.
Re:Building a web application with Rust and WebAssembly by torstenvl on Wednesday June 15, 2022 @09:50PM (#31761715)
I know a lot about web development (for a non-professional). I know very little about modern trends. This approach has served me very well in the past, where I avoided wasting absurd amounts of time and money on things like ActiveX and ColdFusion.

Instead of making personal attacks, which are against site guidelines, why don't you actually try articulating the value proposition that several posters are asking about? This is a place for substantive discussion.

Re:Building a web application with Rust and WebAssembly by hermanradtke on Wednesday June 15, 2022 @10:15PM (#31761842)
Webpack is roughly 10 years old. While you may choose not to use it (like you avoided ActiveX) you should be aware of it if you call yourself a web developer.
Re:Building a web application with Rust and WebAssembly by mrits on Wednesday June 15, 2022 @10:34PM (#31761941)
If you learned ActiveX you could have had a 25+ year long career. It probably would have been worth the weekend investment.