Japp
Learning Rust after twenty years with PHP and JS

Learning Rust after twenty years with PHP and JS

Rust's borrow checker made me feel like a beginner again, and it's not as bad a feeling as I expected.

PHP and JavaScript are generous languages. They let you do strange things with a value’s type, manage memory for you without asking, and if something goes wrong it’s usually the user who finds out in production, not you in the editor. After twenty years there, starting with Rust has been the dose of humility I didn’t know I needed.

The borrow checker isn’t your enemy, even though it feels like it

I spent the first two weeks arguing with the compiler more than writing actual logic. The borrow checker — the system that watches who owns each piece of data and for how long it can be used — rejected code that looked perfectly reasonable to me. I’d pass a variable to a function and then the compiler would tell me I couldn’t use it again, as if the function had kept it forever.

What took me a while to understand is that the compiler wasn’t messing with me: it was pointing out, at compile time, exactly the kind of error that in JavaScript shows up as an elusive bug three weeks later, in production, that nobody can reproduce. Shifting from “this compiles, I’ll fix what breaks later” to “if it compiles, it’s already in pretty good shape” was hard, but once it clicks, it changes how you think about code even when you go back to JavaScript.

Why now, and why Rust

The concrete motivation was Tauri, the framework I use for Facturapp: the native side runs in Rust, and until now I’d limited myself to copying and pasting just enough to make it compile. I wanted to actually understand what I was touching instead of treating it as a black box.

Where I am now

Nothing big yet. Small exercises, a couple of terminal commands of my own to replace scripts I used to write in Node, and a lot, lot of reading the official book. I don’t know if Rust will become a language I use daily, but the exercise of thinking about ownership and data lifetimes is already changing how I write code everywhere else — I even find myself pausing in a Svelte component now to think about who “owns” a piece of state before spreading it across three different places.

Japp ©2026

Leave without saving?

You have unsaved changes in this form. If you leave now, they'll be lost.

esen