SAR: Learning Cross-Language API Mappings with Little Knowledge
Not on the map. Why?
Abstract (arXiv)
To save manual effort, developers often translate programs from one programming language to another, instead of implementing it from scratch. Translating application program interfaces (APIs) used in one language to functionally equivalent ones available in another language is an important aspect of program translation. Existing approaches facilitate the translation by automatically identifying the API mappings across programming languages. However, all these approaches still require large amount of manual effort in preparing parallel program corpora, ranging from pairs of APIs, to manually identified code in different languages that are considered as functionally equivalent. To minimize the manual effort in identifying parallel program corpora and API mappings, this paper aims at an automated approach to map APIs across languages with much less knowledge a priori needed than other existing approaches. The approach is based on an realization of the notion of domain adaption combined with code embedding, which can better align two vector spaces: taking as input large sets of programs, our approach first generates numeric vector representations of the programs, especially the APIs used in each language, and it adapts generative adversarial networks (GAN) to align the vectors from the spaces of two languages. For a better alignment, we initialize the GAN with parameters derived from optional API mapping seeds that can be identified accurately with a simple automatic signature-based matching heuristic. Then the cross-language API mappings can be identified via nearest-neighbors queries in the aligned vector spaces.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). First posted on arXiv 10 Jun 2019.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 2; 2022: 1; 2023: 2.
5 papers.
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2023The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generationcited by 20
- 2022Cross-Language Binary-Source Code Matching with Intermediate Representationscited by 13
- 2021Cross-Lingual Transfer Learning for Statistical Type Inferencecited by 2
- 2021Embedding Code Contexts for Cryptographic API Suggestion:New Methodologies and Comparisonscited by 0
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation9 May 2023
- 2022Cross-Language Binary-Source Code Matching with Intermediate Representations19 Jan 2022
- 2021Cross-Lingual Transfer Learning for Statistical Type Inference1 Jul 2021
- 2021Embedding Code Contexts for Cryptographic API Suggestion:New Methodologies and Comparisons15 Mar 2021