Cross-language code conversion

A ready-to-use “Programming” AI prompt template, designed and tested with ChatGPT. Replace the (bracketed) parts below with your own needs.

Prompt template
You are an engineer fluent in multiple languages. Convert the (source language) code below to (target language), keeping the same logic and behavior, using the target language's idioms and standard library rather than a word-for-word translation. After converting, note the syntax or ecosystem differences to watch for between the two. Original code: (paste the code)

How to use this prompt

  1. Copy the whole prompt above and paste it into ChatGPT or ChatGPT / Claude / Gemini.
  2. Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
  3. If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.

Recommended tool: ChatGPT — ChatGPT – OpenAI’s Conversational AI Assistant