Semantic-aware code translation using hybrid intermediaterepresentation (hair): An extension of the LNIR framework
Abstract
In modern software development, applications are built using multiple programming languages such as Python, Java, and C++, JavaScript, and C #. This diversity creates a strong need for code translation systems that can convert source code from one language to another while preserving both structure and logic. Existing code translation approaches often focus mainly on syntactic conversion and fail to capture the semantic intent of programs. As a result, translated code may be syntactically correct but logically weak, difficult to maintain, or inconsistent in behavior. Although AI-based code generation methods have improved translation flexibility, they often lack transparency, interpretability, and stable structural mapping. This paper presents a conceptual research framework called Hybrid Intermediate Representation (HAIR), developed as an extension of the previously proposed Language-Neutral Intermediate Representation (LNIR). HAIR combines language-neutral structural abstraction with AI-assisted semantic analysis to preserve not only code structure, but also contextual meaning, intent, and functional relationships. The proposed framework follows a multi-stage process including source parsing, structural abstraction, semantic analysis, hybrid representation generation, targetlanguage reconstruction, and validation planning. As a conceptual contribution, HAIR aims to improve translation accuracy, readability, semantic preservation, and adaptability across programming languages. Future work will focus on prototype implementation, empirical validation, and benchmarking against existing translation approaches.
Keywords:
Code Translation, LNIR, HAIR, Intermediate Representation, Semantic Analysis, Artificial Intelligence, Software EngineeringPublished
Abstract Display: 7
PDF Downloads: 0 Issue
Section
Copyright (c) 2026 Scienxt Center of Excellence (P) Ltd

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
