Code prompts
Code prompt

Convert this code from X to Y

You're migrating between languages or frameworks and need a translation that respects idioms of the target.

Works best in: Claude

Convert this code from {{source language/framework}} to {{target language/framework}}.

```{{source language}}
{{paste source code}}
```

Constraints:
- Preserve behavior, not syntax. Idiomatic target code, not a literal translation.
- Use the conventional libraries/patterns of the target language (not whatever maps 1:1 from source).
- Flag anything that doesn't translate cleanly (e.g., source uses goroutines, target is single-threaded).

Output:
1. The converted code
2. **Key translation decisions** — bullet list of where I made non-obvious choices and why
3. **Behavior gaps** — any subtle differences in semantics between source and target that the user needs to know
4. **What to test first** — given the translation, what's most likely to behave differently than the original?
·Open in·Share
migrationtranslationcross-language

More code prompts

All code prompts

Go deeper