Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 2.42 KB

File metadata and controls

64 lines (47 loc) · 2.42 KB

Rust is Like TypeScript

🚧 Migration In Progress: This repository is being migrated from "TypeScript is Like C#" to "Rust is Like TypeScript". Some content may still reference C#. See Plan.md for the migration plan.

This repository publishes a set of docs aimed at helping TypeScript developers learn Rust for specific use cases where its unique guarantees shine.

Why This Guide?

Many teams find themselves in situations where TypeScript/Node.js hits limitations:

  • Performance-critical services need better throughput
  • CLI tools could benefit from faster startup and zero dependencies
  • WebAssembly modules need predictable, efficient code
  • System utilities require memory safety without garbage collection

Rust offers:

  • Memory safety without GC through ownership and borrowing
  • Zero-cost abstractions with predictable performance
  • Fearless concurrency with compile-time data race prevention
  • Modern tooling (Cargo, rustfmt, clippy)
  • WebAssembly as a first-class compilation target

When to Use Rust vs TypeScript?

Use Rust for:

  • CLI tools and system utilities
  • Performance-critical backend microservices
  • WebAssembly modules (compute-heavy frontend code)
  • Infrastructure tooling
  • Services where predictable performance matters

Stick with TypeScript for:

  • Full-stack web applications
  • Rapid prototyping
  • Teams without systems programming experience
  • Projects where GC pause times don't matter

About This Guide

This guide uses side-by-side code comparisons to help TypeScript developers understand Rust concepts. We're honest about the learning curve while showing why the investment is worthwhile for the right problems.

Contributing

👋🏼 Hey there, interested in contributing?

Fork and make a PR! Most of this repo is simply markdown so it's easy to contribute.

To run locally:

# From the root
yarn --cwd docs docs:dev

Guidelines

  • No language bashing; we're focused on educating
  • Be honest about Rust's learning curve
  • Write clear, concise, easy-to-follow examples
  • Distill examples to the simplest use case demonstrating the idea
  • Write both TypeScript and Rust side-by-side
  • Show ownership/borrowing implications in examples
  • Include compiler error examples when relevant
  • Link to The Rust Book for deep dives on complex topics
  • Use VitePress markdown extensions where appropriate including code line highlighting