Neural Code Translation of Legacy Code: APL to C#

📅 2026-05-12
📈 Citations: 0
Influential: 0
📄 PDF

career value

162K/year
🤖 AI Summary
This work addresses the challenge of automatically translating APL code into C#, a task hindered by APL’s sparse syntax, scarcity of parallel corpora, and high domain-specific barriers. To overcome these limitations, the authors propose a large language model–based neural code translation framework that integrates natural language–mediated guidance, retrieval-augmented generation, and iterative refinement, complemented by a dual verification mechanism based on compilation and execution. The study introduces the first multi-level APL-to-C# equivalent code dataset and an automated functional validation evaluation pipeline, moving beyond conventional direct translation approaches. Experimental results demonstrate that the proposed method substantially improves both translation quality and functional correctness, successfully enabling accurate conversion of APL programs of varying complexity into idiomatic C#.
📝 Abstract
Automatic translation between programming languages remains a challenging problem, particularly when the source language is highly concise and specialized. This paper investigates the translation of APL into C# using large language models. The task is difficult due to APL's sparse syntax, the scarcity of large-scale parallel corpora, and the requirement for specialized knowledge to interpret APL programs. To address these challenges, we introduce a novel framework for APL-to-C# translation by comparing three guided strategies, namely natural language description-mediated, retrieval-augmented, and iterative refinement, against a baseline direct translation model. We constructed multiple datasets of functionally equivalent code pairs spanning various levels of complexity, and to rigorously assess translation quality, we developed an automated evaluation pipeline that verifies both syntactic compilation and functional execution of the generated C# code. Our results demonstrate that neural code translation can successfully bridge the gap between APL and C# for a wide range of programs, and that incorporating additional context and guidance significantly improves model performance.
Problem

Research questions and friction points this paper is trying to address.

neural code translation
APL
C#
legacy code
programming language translation
Innovation

Methods, ideas, or system contributions that make the work stand out.

neural code translation
APL-to-C# translation
guided translation strategies
retrieval-augmented generation
automated evaluation pipeline