Coding to Rust: A Claude Code Skill Collection for Migrating 16 Mainstream Languages to Rust

Coding to Rust — a skill collection for migrating to Rust from many languages

English

Project overview

Coding to Rust is a Claude Code skill collection that provides a complete guide for migrating from 16 mainstream programming languages to Rust. For each language it offers:

  • Architecture mapping — runtime differences, paradigm shifts, memory model comparisons
  • Type system mapping tables — 30-80 precise type/syntax mappings
  • Framework migration guides — how mainstream frameworks map to the Rust ecosystem (such as Django→Axum, Spring→Actix)
  • Idiom comparisons — before/after comparisons with code examples
  • Common mistakes — the mistakes developers from that language make most often in Rust, and how to fix them
  • Incremental FFI migration strategy — a phased replacement plan
  • Reference implementations — real-world migration cases and projects

    Covered languages

# Language Directory Core paradigm shift
1 Python python-to-rust/ GIL→true parallelism, asyncio→tokio, numpy/pandas→ndarray/polars
2 JavaScript/TypeScript nodejs-to-rust/ event loop→tokio, V8→AOT, Express→Axum
3 Go go-to-rust/ goroutine→tokio task, channel→mpsc, GC→ownership
4 Java java-to-rust/ JVM→native binary, Spring→Axum, JPA→sqlx
5 C# csharp-to-rust/ CLR→native, LINQ→iterators, ASP.NET→Axum
6 PHP php-to-rust/ dynamic types→static types, FPM→long-running process, Laravel→Axum
7 C c-to-rust/ malloc/free→ownership, pointers→references, header files→modules
8 C++ cpp-to-rust/ templates→generics, virtual functions→traits, move semantics→ownership
9 Zig zig-to-rust/ comptime→macros, allocators→ownership, error sets→Result
10 Lua lua-to-rust/ table→struct/enum, metatable OOP→traits, coroutine→async
11 R r-to-rust/ data.frame→polars, formula→builder, apply→iterators
12 Julia julia-to-rust/ multiple dispatch→traits, JIT→AOT, Array→ndarray
13 Kotlin kotlin-to-rust/ Coroutines→tokio, data class→struct, sealed class→enum, Gradle→Cargo
14 Swift swift-to-rust/ ARC→ownership, actor→Mutex, protocol→trait, SwiftUI→Leptos
15 Ruby ruby-to-rust/ GC→ownership, blocks→closures, Rails→Axum, Bundler→Cargo
16 Vue vue-to-rust/ :warning: (frontend/WebAssembly — not backend) SFC→component functions, ref()→RwSignal, Vite→Trunk

Project structure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
coding-to-rust/
├── README.md # this file — project documentation (Chinese)
├── README.en.md # English version of the documentation
├── SKILL.md # main entry point (Claude Code loads this file)
│ - quick selector for the 16 languages
│ - general migration concepts (ownership/async/error handling/build systems)
│ - 6-8 core quick-mapping entries per language
│ - cross-language common mistakes
│ - language-agnostic 5-phase migration strategy

├── python-to-rust/ # Python → Rust detailed guide
├── php-to-rust/ # PHP → Rust detailed guide
├── nodejs-to-rust/ # JS/TS → Rust detailed guide
├── csharp-to-rust/ # C# → Rust detailed guide
├── cpp-to-rust/ # C++ → Rust detailed guide
├── zig-to-rust/ # Zig → Rust detailed guide
├── java-to-rust/ # Java → Rust detailed guide
├── r-to-rust/ # R → Rust detailed guide
├── go-to-rust/ # Go → Rust detailed guide
├── julia-to-rust/ # Julia → Rust detailed guide
├── c-to-rust/ # C → Rust detailed guide
├── lua-to-rust/ # Lua → Rust detailed guide
├── kotlin-to-rust/ # Kotlin → Rust detailed guide
├── swift-to-rust/ # Swift → Rust detailed guide
├── ruby-to-rust/ # Ruby → Rust detailed guide
└── vue-to-rust/ # Vue → Rust (WASM) detailed guide

Design principles:

  • Index entry pointSKILL.md is the main entry, and Claude Code loads it automatically based on keywords
  • Independently readable — each language directory’s SKILL.md can be used on its own, without depending on other files
  • Progressive depth — quick mapping tables (index layer) → architecture mapping (concept layer) → code examples (hands-on layer) → reference projects (verification layer)
  • Cross-references — languages reference shared patterns across each other (for example, Python’s asyncio and Go’s goroutine both map to tokio)

Usage

How to trigger it

In a Claude Code conversation, any of the following will automatically load this skill:

  • “Migrate this Python code to Rust”
  • “Rewrite this Go service in Rust”
  • “How do I implement Java’s Spring Boot in Rust”
  • “Port this C++ class hierarchy to Rust”
  • “Migrate Node.js Express app to Rust”

Workflow

  1. Auto-load — Claude Code recognizes the migration request and loads coding-to-rust/SKILL.md
  2. Quick mapping — look at the 6-8 core mappings for your language to quickly get the rough correspondence
  3. Deeper lookup — when you need code examples or detailed framework comparisons, Claude automatically reads the detailed SKILL.md for that language
  4. Cross-reference — for patterns shared across languages, it links to the corresponding sections in other languages via cross-references

Whichever source language you start from, it’s best to migrate in this order:

Phase Content Approach
1 Data types Define the corresponding Rust struct/enum, shared via a JSON/Protobuf schema
2 Pure functions Migrate stateless logic first — no external dependencies, easiest to test
3 I/O boundaries Replace HTTP handlers, database queries, file reads/writes
4 Concurrency model Convert threads/coroutines/async tasks uniformly into tokio tasks
5 Full cutover Remove the source language runtime, keeping only an FFI bridge for a compatibility transition

File size reference

Level Corresponding file Size When to use
Light Index layer quick mapping table ~8 lines/language Quick lookup to confirm basic mappings
Medium Index layer general concepts ~60 lines Understand Rust’s core paradigms
Detailed Each language’s SKILL.md 600-1000 lines Deep migration, code examples, framework comparisons

Contributing

To add a language, fix an error, or improve the example code, edit the SKILL.md file for that language, and update the quick mapping table and links in the coding-to-rust/SKILL.md index as well.