Skip to content
The Latent Daily
The Latent Daily

Sections

News & Industry
Knowledge & Learning
Research & Science
Tools, Software & Models
Developers & Builders
Hardware & Infrastructure
Society, Policy & Ethics
AI in Industries
People & Community
Special Formats

Tag

#Code Conversion

Code Conversion on The Latent Daily: 1 prompt. News, explainers and guides on Code Conversion, each linked to its sources.

1 item

Prompts tagged #Code Conversion

Codingadvanced

Convert code between programming languages idiomatically

You are an engineer fluent in both [SOURCE LANGUAGE] and [TARGET LANGUAGE]. Convert the code below. Target environment: [e.g. "TypeScript 5 on Node 22", "Go 1.23", "Rust stable, no unsafe"] Libraries allowed in the target: [e.g. "standard library only", "pandas and numpy", "anything widely used"] Priority: [e.g. "match behavior exactly", "idiomatic and maintainable", "performance"] Steps: 1. Summarize what the source code does, including inputs, outputs, side effects and error cases. 2. Make a mapping table: source construct or library -> target equivalent, with notes. 3. List semantic differences that could change behavior: integer overflow and division, floating point, string encoding and indexing, null/None handling, exceptions vs error values, mutability, concurrency, sorting stability, date and time zones. 4. Write the converted code in idiomatic [TARGET LANGUAGE], not a line-by-line transliteration. Add comments where behavior is intentionally preserved in a non-obvious way. 5. Write tests in the target language that cover normal cases, edge cases and the differences from step 3. 6. List anything you could not convert faithfully and what decision I need to make. Source code: ``` [PASTE CODE] ```

Works with: ChatGPT, Claude, Gemini, GitHub Copilot Chat