News

Solo Developer Builds AI-Powered Code Translator Transpiler.us for 27 Languages, Achieving Production-Quality Output with Llama 3.3 70B

Solo Developer Builds AI-Powered Code Translator Transpiler.us for 27 Languages, Achieving Production-Quality Output with Llama 3.3 70B

Developers frequently encounter a common challenge: existing code functions perfectly but is written in the 'wrong' language for a new project, such as migrating a Python service to Go or rewriting a JavaScript utility in TypeScript. Attempting to use general-purpose LLMs like ChatGPT for translation often yields unsatisfactory results, with incorrect imports, missing error handling, or non-idiomatic code that wouldn't survive a code review.

Addressing this frustration, a solo developer built Transpiler.us. This AI-powered code translator is specifically engineered for this problem, not just a general chatbot with a translation prompt. It's designed from the ground up to produce production-quality output across 27 programming languages, ensuring correct imports, robust error handling, and idiomatic patterns for the target language, rather than merely syntax-swapped source code.

Beyond its core translation capabilities, the Transpiler.us platform includes several supplementary tools to enhance developer workflow:

  • AI Code Reviewer: Provides structured feedback covering bugs, security vulnerabilities, performance, and style.
  • GitHub Integration: Allows direct translation and pushing of code to any repository via OAuth.
  • JSON/YAML Formatter: Validates, formats, and converts between JSON and YAML formats.
  • Regex Tester: Offers live pattern matching with support for named groups.
  • CLI Tool: Available as `code-translator-ai` on npm for terminal and pipeline use.

The project's technology stack was kept simple to facilitate solo development:

  • Frontend: Built with React + Vite + TailwindCSS and deployed on Vercel.
  • Backend: Powered by Express + TypeScript, deployed on Railway.
  • AI Model: The core AI functionality is driven by Llama 3.3 70B, accessed via the Together AI API. This model was a deliberate choice, as it consistently produced the cleanest translations during testing, particularly for less common language pairs like Rust to Zig or COBOL to Java.
  • Payments: Handled by Stripe for credit packs and a $20/month Pro subscription.
  • Auth: GitHub OAuth is used for repository integration.

The secret to a truly good code translation isn't simply sending code to an LLM and returning the result; that naive approach yields garbage about 30% of the time. What truly works is being highly specific in the prompt about what constitutes "good" code in the target language and structuring the output to ensure reliable parsing. The system prompt used in Transpiler.us reflects this meticulous approach, ensuring accuracy and usability of the translated code. Below is the actual system prompt utilized by the translator:

function buildSystemPrompt(
  source: Language,
  target: Language,
  preserveComments: boolean,
  addExplanations: boolean
): string {
  return `You are an expert code translator. Translate code from ${source.name} to ${target.name} accurately.

Rules:
1. Translate faithfully — preserve all logic and behavior
2. Use idiomatic ${target.name} patterns
3. Use appropriate ${target.name} standard library equivalents
4. ${preserveComments ? "Preserve all comments" : "Remove comments unless critical"}
5. ${addExplanations ? "Add brief inline comments explaining non-obvious translations" : "Keep output clean"}
6. Output ONLY the translated code — no mark`
}

↗ Read original source