SWIM: Synthesizing What I Mean
Not on the map. Why?
Abstract (arXiv)
Modern programming frameworks come with large libraries, with diverse applications such as for matching regular expressions, parsing XML files and sending email. Programmers often use search engines such as Google and Bing to learn about existing APIs. In this paper, we describe SWIM, a tool which suggests code snippets given API-related natural language queries such as "generate md5 hash code". We translate user queries into the APIs of interest using clickthrough data from the Bing search engine. Then, based on patterns learned from open-source code repositories, we synthesize idiomatic code describing the use of these APIs. We introduce structured call sequences to capture API-usage patterns. Structured call sequences are a generalized form of method call sequences, with if-branches and while-loops to represent conditional and repeated API usage patterns, and are simple to extract and amenable to synthesis. We evaluated SWIM with 30 common C# API-related queries received by Bing. For 70% of the queries, the first suggested snippet was a relevant solution, and a relevant solution was present in the top 10 results for all benchmarked queries. The online portion of the workflow is also very responsive, at an average of 1.5 seconds per snippet.
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). First posted on arXiv 26 Nov 2015.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 4; 2022: 3; 2023: 1; 2024: 1; 2025: 0; 2026: 1.
10 papers.
- 2024Compositional API Recommendation for Library-Oriented Code Generationcited by 10
- 2022On the Effectiveness of Pretrained Models for API Learningcited by 9
- 2021Natural Language-Guided Programmingcited by 4
- 2021A Systematic Review of Automated Query Reformulations in Source Code Searchcited by 2
- 2021Plot2API: Recommending Graphic API from Plot via Semantic Parsing Guided Neural Networkcited by 1
- 2021Procedures as Programs: Hierarchical Control of Situated Agents through Natural Languagecited by 0
- 2022Code Sophistication: From Code Recommendation to Logic Recommendationcited by 0
- 2022Code Compliance Assessment as a Learning Problemcited by 0
- 2023Contrastive Prompt Learning-based Code Search based on Interaction Matrixcited by 0
- 2026XSearch: Explainable Code Search via Concept-to-Code Alignmentcited by 0
- 2026XSearch: Explainable Code Search via Concept-to-Code Alignment15 May 2026
- 2024Compositional API Recommendation for Library-Oriented Code Generation29 Feb 2024
- 2023Contrastive Prompt Learning-based Code Search based on Interaction Matrix10 Oct 2023
- 2022Code Compliance Assessment as a Learning Problem10 Sep 2022
- 2022On the Effectiveness of Pretrained Models for API Learning5 Apr 2022
- 2022Code Sophistication: From Code Recommendation to Logic Recommendation19 Jan 2022
- 2021Procedures as Programs: Hierarchical Control of Situated Agents through Natural Language16 Sep 2021
- 2021A Systematic Review of Automated Query Reformulations in Source Code Search22 Aug 2021
- 2021Natural Language-Guided Programming11 Aug 2021
- 2021Plot2API: Recommending Graphic API from Plot via Semantic Parsing Guided Neural Network2 Apr 2021