DEV Community

Cover image for Migrate your HTML project to Rust + Dioxus or you are doomed!!
ronynn
ronynn

Posted on

Migrate your HTML project to Rust + Dioxus or you are doomed!!

I have a friend who after reading some blog posts and social media memes that rust is the future and what not used to keep suggesting anything I am making should be made in rust.

So this friend of mine recently started learning HTML and was making a simple personal page. I for some reason wanted to make a meme about how he should be using rust for this too. So I sat down and wrote this entire article, posted it on the issues section of his repo. We had a good laugh but I thought I would like to get more thoughts on this too from others.


Critical Concern for the Future of This Project


I just happened to stumble upon this repo and was immediately struck by something concerning. You’ve chosen HTML as the foundation for your personal page, this path is not sustainable long-term, this is a house of cards. If you don’t act now, I fear you will soon face crippling technical debt and, ultimately, a full-scale rewrite.

HTML simply doesn’t have the type safety, memory safety, or concurrency features necessary for a modern, production-grade personal webpage. Right now, sure, it might load quickly, and yes, it might be accessible to virtually every browser with minimal overhead—but at what cost?

Why Rust + Dioxus is the only sensible choice

  1. While technically, benchmarks indicate that HTML and raw JavaScript are faster than Rust on the web, you have to remember that speed isn’t everything. Dioxus introduces valuable abstractions, Rust’s advanced memory management ensures that your <h1> tags and <p> elements are allocated the same level of architectural rigor as a distributed systems backend, or a aerospace control system.

  2. Today, it’s “just” a personal page. But what happens when you need to scale? What if you decide to add a second page? Or ... a contact form? With HTML, you’d have to copy-paste code. With Rust, you can write robust, reusable components with compile-time safety. It’s a no-brainer.

  3. Your current setup has zero protections against memory leaks, buffer overflows. Dioxus, leveraging Rust’s borrow checker, ensures that every <h1> tag and <p> element is safely allocated and deallocated. You never know when a mismanaged <div> might lead to catastrophic undefined behavior. Right now, your HTML is raw, unprotected, and vulnerable. Anyone could open DevTools and inspect your elements. This is a security risk. Rust’s borrow checker ensures that every <div> is allocated safely, and best of all—once compiled, nobody can modify your page without a complete recompile.

  4. Concurrency – Your website may not be using threads now, but what happens when it needs to? Imagine multiple users visiting at the same time. Can your current setup guarantee data race safety? Rust can.

I have written a hello world program in Rust before, which I believe qualifies me to assist in this migration. Under your guidance, I’d be more than happy to contribute and help rewrite this entire project in a safer, more performant stack, your personal webpage will finally be in a production-ready state, capable of handling enterprise-level traffic without breaking a sweat.

You need to future proof your page against inevitable HTML deprecations.


Changed one line to make it funnier.

So what did you think of this? Don't tell me you actually agreed.

Top comments (0)