The Future of the Web: Why It Doesn't Have to Be JavaScript

I am a professional web developer. I use JavaScript on a daily basis, but to be honest I harbor a bit of hate for the language. Don't get me wrong, it does its job and does it well enough, but... there's a reason TypeScript exists.

Despite its glaring flaws, JavaScript is currently the most widely used programming language in the world. JavaScript's stratospheric growth is largely driven by the growth of the Internet and web technologies. And while JavaScript exists on the server, it was born for the web. For decades it's been the primary way to write websites and that won't be dramatically changing anytime soon.

However, the future is on the horizon. WebAssembly (WASM) is a technology being developed as a new type of bytecode meant to run in web browsers. While WASM is relatively rare to see in the wider programming world right now, it has been supported in modern browsers for years.

Do you know what this means?

We're free.

Free from being forced to use JavaScript, a language thrown together in 8 days with some of the most confounding behaviors I've ever encountered in my years of programming.

So what do we do with all that freedom?

Work with a better language!

WASM is likely supported by your favorite language, and frameworks and tools for building web apps are being created and refined every single day. So the next time you need to build a website, give your technology selection a second thought.

It doesn't have to be JavaScript.

WASM + Rust

My favorite WASM-supported language is Rust (which you already know if you've ever had a conversation about programming with me). During the pandemic while I had nothing better to do with my free time, I read The Rust Book and fell in love with its thoughtful design and developer experience. I enjoy it so much that it's my goal to someday work with Rust professionally.

However, the web development ecosystem still needs a little more growth so it will be a bit longer before I get paid to write a web app in Rust. Other languages face the same barrier, but exciting projects like Yew (Rust) and Blazor (C#) are getting better each day.

Dicebag

Recently I decided to put WASM to the test with a serious effort to build a website completely in Rust, doing my best to select tooling and frameworks that replicate what I do with JavaScript/TypeScript during my day job.

The result is Dicebag! I regularly play Dungeons & Dragons and haven't been happy with the online tools my group and I have used, so I'm building tools that will help us have a better experience. As of this writing, it's an ugly, non-interactive Character Sheet, but it gets a tad bit better every time I work on it. If you're curious at checking out the code hop on over to the repository on GitHub. Contributions are more than welcome!

Despite the site not being very fancy, I am very happy with the progress so far regarding the tooling to facilitate development. Here's a short list of each framework or tool I'm using with its equivalent in JavaScript land (where applicable):

  • Trunk replaces Webpack
  • Yew replaces React
  • Rust-specific GitHub CI/CD actions

So far I've really enjoyed the experience with the tooling. None of them have reached version 1.0 at this point, but things are functional and you can produce a complete app with them. I'm sure I'll run into more issues as the site becomes more complex, but the basics are there!

My goal with Dicebag is to provide tools like character sheets, equipment and spell management, custom views to facilitate gameplay by presenting contextually relevant choices, a DM encounter builder, a dice roller, and more. It should be perfectly usable whether you're the only one using it in your group or if everybody is.

In addition, making this site a success will prove out the technology and give me a story to tell the next time I try to convince my co-workers to choose Rust on their next project. Plus, finding the pain-points allows me to contribute to the ecosystem's development by opening issues on GitHub or even contribute code to make the tools better.

We'll see where this project goes, but I'm excited!

Someday I'll never have to write JavaScript again.


You'll only receive email when they publish something new.

More from Lane Sawyer🌹
All posts