A practical Rust guide written for TypeScript developers — side-by-side code comparisons, runnable examples, and no C/C++ background required.
Live site: rust-with-typescript
Most Rust learning resources assume a systems programming background. This guide takes a different approach: every concept is explained through the lens of TypeScript.
- Side-by-side code: TypeScript and Rust examples shown together
- Runnable code: Execute Rust snippets directly in the browser
- Bilingual: English and Korean
- 14 chapters covering syntax, ownership, traits, concurrency, and more
src/
├── content/docs/ # Documentation (Markdown/MDX)
│ ├── *.md # English chapters
│ └── ko/ # Korean chapters
├── expressive-code/ # Custom plugin for runnable code blocks
├── lib/ # Utilities + generated hash file
├── pages/api/run-rust.ts # API endpoint for code execution
└── styles/custom.css # Theme customization
sandbox-runner/ # Rust axum server (code execution backend)
scripts/ # Build-time scripts
bun install
bun run dev # → http://localhost:4321bun run build # Generates code hashes + builds
bun run preview # Preview production build| Command | Action |
|---|---|
bun run dev |
Start local dev server at localhost:4321 |
bun run build |
Generate hashes + production build → ./dist/ |
bun run preview |
Preview the production build locally |
See CONTRIBUTING.md for how to add chapters, fix errors, or translate content.
| Layer | Tech |
|---|---|
| Framework | Astro + Starlight |
| Deployment | Cloudflare Workers |
| Code runner | Rust + Axum on Fly.io |
| i18n | Starlight built-in + Accept-Language middleware |
MIT