~/portfolio

~/blog / learning-rust-as-a-web-developer

Learning Rust as a Web Developer

Learning Rust as a Web Developer

Most of my work is backend web development. But a while ago I started learning Rust. Here is why, and how it changed the way I code.

Why a Web Developer Should Try Rust

Rust is different from Python or JavaScript. It makes you think carefully about memory and ownership. That sounds hard, but the payoff is big:

  • you write faster and safer code
  • you understand what the computer really does
  • you build tools that run anywhere with no runtime

The Ownership Idea, Simply

In many languages the garbage collector handles memory for you. In Rust, the compiler checks at build time who owns a value and when it can be freed. This is called ownership and borrowing.

It was strange at first. But the compiler gives clear messages, and it teaches you good habits.

Where Rust Is Useful

I use Rust for:

  • small CLI tools (like Nit, my Git clone)
  • fast scripts that need to be reliable
  • web services with frameworks like Axum
  • WebAssembly for the browser

What I Learned from Nit

I built a small Git clone in Rust. It taught me:

  • how binary formats work
  • how zlib compression works
  • how SHA-1 hashing works
  • how to read and parse files safely

None of this was necessary for web development. But it made me a more careful programmer.

Start Small

You do not need to rewrite your project in Rust. Just:

  1. install Rust with rustup
  2. write a small CLI tool
  3. run cargo test and write some tests
  4. read the compiler messages carefully

Final Thoughts

Rust will not replace my Python or Django work. But learning it made me better at all of them. It is worth the effort.