Why I’m learning Rust (as a JavaScript dev)

Htoo Pyae Lwin
3 min readOct 28, 2022
Photo by Zdeněk Macháček on Unsplash

I started to learn Rust a few months ago. But the reason why I did was unclear to me now that I think about it. For sure Rust is a great language and has been really popular, I’ve been seeing many posts on every platform about Rust and how great it is. That got me started to have an interest in it but it’s not really the reason why I should be learning it. So these are my thoughts on Rust and why we should learn about it.

A little bit about Rust

Rust is a system-programming language that focuses on speed, type safety, and concurrency. Rust proposed a unique approach to memory safety with ownership and doesn’t have a garbage collector cuz there’s no need for that. Rust has a great ecosystem with tools like cargo for dependency management and also comes with great documentation and community.

So, okay. Why am I learning it as a current JavaScript developer whose day-to-day job is not really about system-level stuff? My day-to-day job is building web applications, servers, user interfaces, and sometimes command-line applications. I mainly work with TypeScript, React, and NestJS.

The main reason why I started to learn yet another programming language is that besides JavaScript, I wanted to have a strong knowledge of a very good structured language. So if I ever want to pivot, I will have a good option.

Another thing is that I’m interested in building system applications like simulators, CLIs, etc. And I chose Rust for the following reasons:

Reason 1: It’s popular

Yes, it’s obvious. Rust has been the most loved language for 7 years straight according to Stack Overflow’s annual survey.

Reason 2: It’s blazingly fast

In short, Rust is a modern language that is as fast as C but with more memory safety controls.

Reason 3: Can target Web Assembly

With Rust, you can build Web apps that are compiled down to wasm. I do believe that JavaScript won’t be replaced for sure but wasm would play (or maybe already) a big role in the coming future.

Reason 4: Everything Rust touches becomes faster

With all the above combined, everything that is built with Rust becomes much faster than the ones that aren’t. There’re many examples of that.

The most recent one would be Turbopack which is the former Webpack but is now built with Rust. Vite has been pretty popular because it was fast but now Turbopack is 10x faster than that. And as for its predecessor, Webpack, it’s faster 700 times 🤯.

Reason 5: Future proof

I do believe that Rust would become a very high-demand language in the future as its ecosystem is evolving speedily. There’re now many frameworks for many areas like Frontend frameworks (Yew), WebGPUs, desktop frameworks (Tauri), etc. As these mature, Rust will play a major part in many software development areas besides system software developments.

--

--