latest on main
- db9627efeat: build Rust guide for TypeScript and JavaScript developersabout 2 months ago
- all commits →
Loading...
Rust for TypeScript and JavaScript developers: a free guide that teaches Rust by mapping every concept to the TS/JS you already know.
git clone https://github.com/zeybek/rs4ts.dev.gitrs4ts.dev is a free guide to Rust for people who already write TypeScript or JavaScript. Every chapter puts the TS you know next to the Rust that does the same job, so you learn the differences instead of starting from zero. It's a website built with Astro Starlight, with search, a chapter sidebar and "Edit on GitHub" on every page, and the same Markdown reads offline from src/content/docs/.
I wrote it for the version of me from a few years ago, comfortable in TypeScript and put off by every Rust intro that assumed C. If you've got a year or so of TypeScript and you're curious about systems programming, fast backends or moving from an interpreted language to a compiled one, it's for you. No Rust needed going in.
// TypeScript: safe under a strict configuration after boundary validation
interface Item
function processData(
return data.map
}// Rust: compile-time safety, zero-cost abstractions, no GC pauses
Same shape, and the Rust version has no garbage collector, catches the null and the data race at compile time, and runs about as fast as C. Cargo covers what npm, webpack and a few other tools do in one place, and the same language reaches the web, the CLI, embedded boards and WASM.
Thirty-one of them, 00 to 30, each a folder under src/content/docs/: the toolchain, the type system, ownership and borrowing, traits, error handling, async, testing and shipping. Read it at rs4ts.dev or run it locally:
npm install #