Translate Code From One Language to Another

Port a snippet to another language idiomatically — matching its conventions, not just transliterating syntax.

0 likes 0 dislikes
Sign in to rate this prompt

Prompt

    Translate the code below from {{source_language}} to {{target_language}}.

Code:
{{code}}

Guidelines:
- Write idiomatic {{target_language}} — use its standard library, naming conventions, and error-handling patterns, not a line-by-line transliteration.
- Preserve the original behavior. If a construct has no direct equivalent, choose the closest idiomatic approach and note the difference.
- Call out anything that can't translate cleanly (language-specific features, libraries with no equivalent, differences in numeric, string, or concurrency behavior) rather than silently papering over it.

Return the translated code, then a short list of the notable decisions or caveats. If part of the original relies on context you can't see, ask.

Like this prompt?

Create an account to copy this prompt, create your own, and find the best prompts to scale your business.