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.
Why this prompt works
-
How to Deploy an AI Agent
Every deployment problem follows from one property: you don't know how long a run takes, because you didn't write the path. Why the run m...
Read the guide → -
MCP Authorization and OAuth
Optional until you opt in, then very specific. Why the resource parameter is mandatory even when the server ignores it, why PKCE doesn't ...
Read the guide → -
MCP Transports: stdio vs Streamable HTTP
There are two transports now, not three, and the one that vanished is the one most tutorials still document. What each is exposed to, why...
Read the guide →