Translating a program written in one programming language to another can be useful for software development tasks that need functionality implementations in different languages. Although past studies have considered this problem, they may be either specific to the language grammars, or specific to certain kinds of code elements (e.g., tokens, phrases, API uses). This paper proposes a new approach to automatically learn cross-language representations for various kinds of structural code elements that may be used for program translation. Our key idea is two folded: First, we normalize and enrich code token streams with additional structural and semantic information, and train cross-language vector representations for the tokens (a.k.a. shared embeddings based on word2vec, a neural-network-based technique for producing word embeddings; Second, hierarchically from bottom up, we construct shared embeddings for code elements of higher levels of granularity (e.g., expressions, statements, methods) from the embeddings for their constituents, and then build mappings among code elements across languages based on similarities among embeddings.
Our preliminary evaluations on about 40,000 Java and C# source files from 9 software projects show that our approach can automatically learn shared embeddings for various code elements in different languages and identify their cross-language mappings with reasonable Mean Average Precision scores. When compared with an existing tool for mapping library API methods, our approach identifies many more mappings accurately. The mapping results and code can be accessed at https://github.com/bdqnghi/hierarchical-programming-language-mapping. We believe that our idea for learning cross-language vector representations with code structural information can be a useful step towards automated program translation.
D3HRL: A Distributed Hierarchical Reinforcement Learning Approach Based on Causal Discovery and Spurious Correlation Detection
College of Computer Science and Technology, National University of Defense Technology(国防科技大学计算机学院);Intelligent Game and Decision Lab (IGDL)(智能游戏与决策实验室);College of Artificial Intelligence, Hebei University of Technology(河北工业大学人工智能学院);School of Electronic information and Electrical Engineering, Shanghai Jiao Tong University(上海交通大学电子信息与电气工程学院)
Self-organizing Democratized Learning: Towards Large-scale Distributed Learning Systems
The University of Danang - Vietnam-Korea University of Information and Communication Technology(岘港大学-越韩信息与通信技术大学);Kyung Hee University(庆熙大学);Aalborg University(奥尔堡大学);The University of Sydney(悉尼大学)
Hierarchical Aggregation Approach for Distributed clustering of spatial datasets
Insight Centre for Data Analytics School of Computer Science University College Dublin(都柏林大学学院计算机科学学院数据洞察中心);School of Computer Science University College Dublin(都柏林大学学院计算机科学学院)
Membership-Mappings for Practical Secure Distributed Deep Learning
Software Competence Center Hagenberg(哈根贝格软件能力中心);Faculty of Computer Science and Electrical Engineering, University of Rostock(罗斯托克大学计算机科学与电气工程学院);Northwestern Polytechnical University(西北工业大学)