NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bridging Language Barriers: A Comparative Review and Empirical Evaluation of Source-To-Source Transpilers

André Freitas, Tiago João Baptista, Pedro Rangel HenriquesSLATE 2025

TL;DR

This paper offers a comprehensive review and empirical evaluation of source-to-source transpilers, tools that translate code between programming languages or versions. It highlights the trade-offs between performance, precision, and usability, providing practical recommendations for selecting the right transpiler for different project needs.

What Problem Does This Paper Address?

Modern software development increasingly relies on diverse programming languages and evolving language standards. This creates challenges in maintaining legacy systems, migrating to new platforms, and ensuring interoperability. Source-to-source transpilers offer a solution by automating code translation while preserving semantic integrity. However, the landscape of transpilers is vast and complex, making it difficult for developers to choose the most suitable tool for their specific requirements. This paper aims to bridge this gap by providing a structured overview and empirical comparison of various transpilers.

Methods

The paper employs a two-pronged approach:

  1. Comprehensive Literature Review: The authors trace the historical evolution of transpilation, from early preprocessors to modern tools like Babel and TypeScript. They delve into key concepts such as parsing methodologies (top-down, bottom-up, GLR), Abstract Syntax Tree (AST) representations, and code transformation strategies (structural, semantic mapping, idiom handling, optimization). They also categorize transpilers into three main types: Language-to-Language, Version, and Paradigm transpilers.
  2. Empirical Study: A curated set of fourteen transpilers, selected based on GitHub popularity and unique language-pair capabilities, were evaluated. The study involved creating a uniform test suite with equivalent code snippets designed to compute the sum of even numbers and find the maximum element in a list. These snippets were written in various input languages (JavaScript/TypeScript, Nim, Clojure, Haxe, C, and Java). The transpilers were then used to translate these snippets, and their performance was measured using metrics like execution time, CPU utilization, memory consumption, and output accuracy.

Datasets

Not discussed in the paper. The paper introduces a custom test suite for evaluating transpilers, which consists of small, equivalent code snippets in multiple languages.

Key Insights and Ideas

  • Transpilers are more than just syntax converters: They operate at a higher level, involving AST construction, semantic transformations, and generation of equivalent target code, aiming to preserve original semantics and intent.
  • Categorization is key: Understanding the difference between Language-to-Language, Version, and Paradigm transpilers helps in narrowing down tool selection based on the migration task.
  • Performance vs. Precision Trade-off is real: Tools that offer raw speed (like jscodeshift) might sacrifice some accuracy, while highly precise tools might have higher resource demands.
  • Tool ecosystems matter: The availability of plugins and rich APIs (like in Babel) significantly impacts usability and extensibility.
  • Legacy systems are a major driver: The paper highlights the significant amount of COBOL code in production, underscoring the need for effective modernization tools.

Key Results

The empirical study revealed significant variations among transpilers:

  • Performance Leaders: Nim demonstrated excellent performance, achieving sub-second translations to C, C++, and JavaScript with high accuracy. jscodeshift was the fastest for lightweight transformations, but with lower accuracy.
  • Balanced Options: Babel and the TypeScript Compiler offered a good balance of precision (around 80-91%) and stability, making them suitable for JavaScript/TypeScript projects.
  • Resource Efficiency: jscodeshift and Fennel were exceptionally frugal in terms of memory consumption.
  • Accuracy: While many transpilers achieved high accuracy, Java2Python, despite perfect stability and other qualitative scores, suffered from a critical functional correctness issue due to a list access method mismatch, resulting in a lower overall precision score.
  • Usability: Babel and jscodeshift were noted for their intuitive interfaces and extensive plugin ecosystems.

Limitations and Future Work

Limitations:

  • The empirical study used small, uniform test cases. Real-world applications involve much larger codebases, complex dependencies, and diverse library ecosystems, which could present different challenges.
  • Some transpilers were excluded due to installation or compatibility issues on the test environment.

Future Work:

  • AI-Augmented Transpilation: Integrating machine learning for context-aware transformations and automatic error correction.
  • Paradigm-Bridging Frameworks: Developing more advanced techniques for accurately converting between functional, imperative, and declarative paradigms.
  • Distributed and Cloud-Native Scenarios: Adapting transpilers to support microservices, serverless deployments, and providing transpilation as a service.
  • Enhanced Benchmarking: Incorporating multi-core scaling, plugin overhead, and real-world codebases for more comprehensive performance analysis.

Summary updated

BibTeX
@inproceedings{freitas2025bridging,
  author = {André Freitas and Tiago João Baptista and Pedro Rangel Henriques},
  title = {{Bridging Language Barriers: A Comparative Review and Empirical Evaluation of Source-To-Source Transpilers}},
  booktitle = {SLATE},
  year = {2025},
  doi = {10.4230/oasics.slate.2025.11},
}

Loading related content...

Figure