Skip to main content
Challenge

Build a Cross-Language Code Translator

This challenge focuses on building an advanced AI agent system for high-fidelity code translation (e.g., Python to Go, Java to Kotlin). The system will leverage Gemini 2.5 Pro's strong code generation capabilities, specifically utilizing its 'Deep Think' mode for profound semantic understanding, and DSPy for programmatic prompting and optimization of the translation pipeline. The process will involve a multi-stage, graph-based workflow: first, understanding the source code's intent and structure; second, generating semantically equivalent target code; and third, robustly validating the translation. Validation will incorporate MCP-enabled static analysis tools, unit test generation, and potentially automated code review, ensuring the translated code is not only functionally correct but also idiomatic to the target language.

Special Purpose AgentsHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Create a DSPy-optimized, Gemini 2.5 Pro-powered agent system for accurate cross-language code translation, integrating MCP-enabled static analysis tools.

Delivery guide

How work is evaluated

Evaluation

The evaluation assesses the system's ability to accurately translate code between specified languages, maintaining functional equivalence, adhering to target language idioms, and passing static analysis checks and unit tests.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Learning goals

What you should walk away with

  • Develop graph-based workflows for robust code parsing, translation, and verification.

  • Integrate static analysis and automated testing tools via Model Context Protocol (Model Context Protocol).

  • Leverage Gemini 2.5 Pro's code generation capabilities in "Deep Think" mode for semantic accuracy.

  • Design and implement a multi-stage code translation agent using DSPy for optimization.

Resources and assets

Reference links and supporting material

Dataset notes

Sample data for 2 tasks

Challenge setup

The evaluation assesses the system's ability to accurately translate code between specified languages, maintaining functional equivalence, adhering to target language idioms, and passing static analysis checks and uni...

Challenge input

{ "source_code": "String", "source_language": "String", "target_language": "String" }

Agent execution

No agent tool is listed for this challenge.

Evaluated output

{ "translated_code": "String", "static_analysis_report": { "errors": [], "warnings": [] }, "unit_test_results": { "passed": "Integer", "failed": "I...

Evaluation checks
  • Verifies that the translated code compiles without syntax errors in the target language.
  • Ensures that all generated/provided unit tests pass successfully for the translated code.
  • Confirms that the Model Context Protocol-integrated static analysis tools report no critical errors.
Configured evaluation evidence
  • SemanticEquivalenceScore target: 95
Configured runtime
  • Python execution harness

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

No tool records are attached.

Evaluation contract

  • Verifies that the translated code compiles without syntax errors in the target language.
  • Ensures that all generated/provided unit tests pass successfully for the translated code.
  • Confirms that the Model Context Protocol-integrated static analysis tools report no critical errors.

Metrics

  • SemanticEquivalenceScore · Target 95
  • IdiomaticAdherenceScore · Target 4
  • StaticAnalysisCleanliness · Target 90
  • CodeReadability · Target 4

Workflow tasks

  1. Task 1

    Input: { "source_code": "String", "source_language": "String", "target_language": "String" }

    Output: { "translated_code": "String", "static_analysis_report": { "errors": [], "warnings": [] }, "unit_test_results": { "passed": "Integer", "failed": "Integer", "total": "Integer" } }

    Execution harness: Python

  2. Task 2

    Input: { "source_code": "String", "target_code": "String", "test_cases": [ { "input": "JSON", "expected_output": "JSON" } ] }

    Output: { "source_test_results": "Boolean", "target_test_results": "Boolean" }

    Execution harness: Python

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Build a Cross-Language Code Translator