Shopping web application

With Rust, can I write a web application that user can run on phone, tablet and PC?

What do you mean exactly?

My take on "web application" is something that runs in a web browser and a backend part that runs on a server (or many).

It should not matter if that browser is running in a phone, tablet or PC or what operating system or browser is in use.

Typically the browser part was written in Javascript or some language that transpires to Javascript. Today we can run WASM in the browser and Rust cane compiled to WASM easily. There are also things like the Yew framework for building web UI with Rust. I have little experience of this but I did off load some computer intensive work to a web worker running Rust compiled to WASM.

Meanwhile at that backend it's pretty easy to put together a web server in Rust using crates like Rocket or Actix. There are also crates for providing websocket connectivity I have been using Rocket with success for a year now.

So, I would say yes. one can write a web application in Rust.

However, there may be a lot missing in that ecosystem at this time. Which may or may not be required by your web application.

Hi, thank you for your very informative answer.
My two years on Gatsby then on Gatsby cloud and Gatsby Themes, there remains nothing to look for, for a full fledged "webapp".
Rust et. al. seems like pointing our left ear with our right hand!!
Best regards

It seems we have a misunderstanding over terminology.

To my mind a "web app" is an application that runs it's from end in the browser. As I described above. Now a days that could be pretty much anything that was previously built as native application for some OS or other.

Turns out what you are looking for a huge all singing all dancing frame work that provides all the features one might need in. Presumably for an on line shopping application in your case.

Like I said, such things may not yet exist in the Rust ecosystem. I'm pretty sure they will come along with time. Or Rust may get used in frameworks that already exist.

Rust is only a language. Like any other language not everything one wants is written in it. It is still pretty new. In the same way Gatsby did not exist for the first two decades of Javascript.

I have no idea what that is supposed to mean.

2 Likes

I mean for a full fledged webapp one needs other tools and add-ons on Rust. So why one might not use Gatsby insted?

While writing web client code is possible with Rust+WASM, it may not be the best choice. Go ahead and use Gatsby if it fits your problem better; half of engineering is picking the right tool for the job, and Rust isn't the right answer to every problem.

1 Like

No reason at all. I'm sure Gatsby is just fine. It's based on React and node.js, Javascript through and through. Sounds great. Javascript is my other favourite language. And I use React in my front ends.

It's only in this last year that I have been reimplementing a lot of things server side in Rust that were previously in Javascript/node.

In general I have found that most Rust enthusiasts do not push the idea that everything should be rewritten in Rust. They are wise enough to know that such major rewrites are a huge effort and expense and subject to a big risk of failure. Either introducing more bugs than you started with or going bankrupt whilst trying.

Rather one can imagine new components of such systems being created in Rust or components being reimplemented in Rust where there is a pressing need, like performance for example.

We already see that in the web and node world. It is pretty easy to create node.js modules in Rust and use them like any other module from Javascript. Similarly for some situations in the browser.

Meanwhile... there are folks already working on creating such frameworks in Rust. For example Ryan Dahl, creator of node.js, is now working on a new node-like serve side system using Rust: GitHub - denoland/deno: A secure JavaScript and TypeScript runtime. Why? For performance and security reasons. Then there is Yew, a React like framework fro the browser.

It's early days yet...

1 Like


Totally agree,
After I "hybernated" for 20+ years, I decided to dive again in 2019 and found Gatsby very friendly.
How ever I will keep Rust up my sleve and wait for the progresses.
Thank you for sharing your views
Regards