3 Months of Learning Rust as a JS Developer
Ownership broke my brain. A JavaScript developer's honest account of learning a language that refuses to think like JS.
Why I started learning Rust
I'll be honest -- it was the hype. JavaScript tools like Deno, SWC, Turbopack, and Biome are all built in Rust. "If I learn some Rust, maybe I can understand how these tools work under the hood?" That's what got me started.
I opened The Rust Programming Language (a.k.a. The Book). Chapter 1 was fine. Hello World, variable declarations. "Isn't this just like C++?"
Chapter 3 broke my brain.
What even is ownership
In JavaScript, you assign a value to a variable, copy it to another variable, and both work. Obvious, right? Rust says no. A value has exactly one owner. Pass it to another variable, and the original can't be used anymore.
I must've yelled "Why is this an error?!" about 37 times a day. The compiler kept spitting out "value moved here" errors, and my JavaScript brain couldn't make sense of it. I spent an entire week just fighting with ownership.
(This was the first time I appreciated how forgiving JavaScript is as a language.)
Lifetimes: the second wall
Once I kinda understood ownership, lifetimes showed up. The concept that a reference can't outlive what it points to, and you have to annotate function signatures with 'a and such.
For 2 weeks, I stared at code that wouldn't compile because of lifetimes, thinking "Why do I have to manage this? Just let the GC handle it." But once it clicked, I understood why Rust is fast. No GC means no runtime overhead.
Month one: built a simple CLI tool
Made a CLI tool that extracts frontmatter from Markdown files. In JavaScript, this would've taken 30 minutes. In Rust, it took 8 hours. String handling is way more involved than JavaScript. The difference between String and &str, between .to_string() and .as_str(). So much to consider just to work with a string.
But when I ran the compiled binary, the speed was shocking. Processing 1,847 files took 2.3 seconds with a Node.js script. Rust did it in 0.04 seconds. 57x faster.
Month two: fell in love with error handling
Rust's Result<T, E> type makes it impossible to ignore errors. In JavaScript, forget a try-catch and it blows up at runtime. In Rust, if you don't handle the Result, it won't compile.
The ? operator for propagating errors upward is clean too. More type-safe than JavaScript's throw, more concise than Go's if err != nil repetition.
Month three: honest assessment
I can see that Rust is a great language. Performance, safety, error handling -- all excellent. But for day-to-day web development, the development speed is just too slow. What takes an hour in JavaScript takes a full day in Rust. Part of that is my still-limited skill, sure.
For CLI tools or performance-critical libraries, Rust makes sense. But I'm not about to build an API server in Rust. JavaScript/TypeScript is still my main tool, and Rust is something I'll pull out when needed.
No regrets about learning it though. My understanding of programming itself feels deeper. Whether 3 months was enough, I'm not so sure.