30171

CrossTL: A Universal Programming Language Translator with Unified Intermediate Representation

Nripesh Niketan, Vaatsalya Shrivastva
arXiv:2508.21256 [cs.PL], (28 Aug 2025)

@misc{https://doi.org/10.5281/zenodo.15826975,

   doi={10.5281/ZENODO.15826975},

   url={https://zenodo.org/doi/10.5281/zenodo.15826975},

   author={Nripesh Niketan, and Vaatsalya Shrivastava,},

   keywords={programming languages, code translation, cross-platform development, GPU computing, graphics programming, shader languages, compiler, intermediate representation, universal translator},

   language={en},

   title={CrossTL: Universal Programming Language & Translator},

   publisher={Zenodo},

   year={2025},

   copyright={Apache License 2.0}

}

We present CrossTL, a universal programming language translator enabling bidirectional translation between multiple languages through a unified intermediate representation called CrossGL. Traditional approaches require separate translators for each language pair, leading to exponential complexity growth. CrossTL uses a single universal IR to facilitate translations between CUDA, HIP, Metal, DirectX HLSL, OpenGL GLSL, Vulkan SPIR-V, Rust, and Mojo, with Slang support in development. Our system consists of: language-specific lexers/parsers converting source code to ASTs, bidirectional CrossGL translation modules implementing ToCrossGLConverter classes for importing code and CodeGen classes for target generation, and comprehensive backend implementations handling full translation pipelines. We demonstrate effectiveness through comprehensive evaluation across programming domains, achieving successful compilation and execution across all supported backends. The universal IR design enables adding new languages with minimal effort, requiring only language-specific frontend/backend components. Our contributions include: (1) a unified IR capturing semantics of multiple programming paradigms, (2) a modular architecture enabling extensibility, (3) a comprehensive framework supporting GPU compute, graphics programming, and systems languages, and (4) empirical validation demonstrating practical viability of universal code translation. CrossTL represents a significant step toward language-agnostic programming, enabling write-once, deploy-everywhere development.
No votes yet.
Please wait...

You must be logged in to post a comment.

* * *

* * *

HGPU group © 2010-2025 hgpu.org

All rights belong to the respective authors

Contact us: