ABSTRACT
Searching for API is a hard problem, as text is not commonly representative of what a program does. In this paper, we present Moogle, a type-based API search engine for open-source Elm packages, with an online demonstration1. In Moogle, queries are based on names or type signatures, whose adequate information is leveraged for matching APIs from open-source libraries. Moogle applies unification algorithm, where generic type signatures can be matched to concrete ones and vice versa. In order to optimize the performance of applied matches, Moogle stores information of type signatures in an AST-based graph model, by applying graph DBMS, Neo4j. Moogle also has its implementation on a parser to convert its DSL, MoogleQL, into AST data models or string queries. According to our test, Moogle outperforms its congeneric work, Elm-search2, on many aspects including search range and allowed patterns with acceptable trade-offs.
- Amir Saboury, Pooya Musavi, Foutse Khomh, and Giulio An-toniol. 2017. An empirical study of code smells in javascript projects. In 2017 IEEE 24th international conference on software analysis, evolution and reengineering (SANER). IEEE, 294--305.Google ScholarCross Ref
- Nicholas C Zakas. 2012. Maintainable JavaScript: Writing Readable Code. " O'Reilly Media, Inc.".Google Scholar
- Neil Mitchell. 2019. Hoogle. https://hoogle.haskell.org/Google Scholar
- Jonas Coch. 2019. Elm-search.https://klaftertief.github.io/elm-search/.Google Scholar
- Raoul-Gabriel Urma and Alan Mycroft. 2015. Source-code queries with graph databases-with application to program-ming language usage and evolution. Science of Computer Programming 97 (2015), 127--134.Google ScholarDigital Library
- Vladimir I Levenshtein. 1966. Binary codes capable of correcting deletions, insertions, and reversals. In Soviet physics doklady, Vol. 10. 707--710.Google Scholar
- Alberto Martelli and Ugo Montanari. 1982. An efficient uni-fication algorithm. ACM Transactions on Programming Lan-guages and Systems (TOPLAS) 4, 2 (1982), 258--282.Google ScholarDigital Library
- John Alan Robinson et al. 1965. A machine-oriented logic based on the resolution principle. J. ACM 12, 1 (1965), 23--41.Google ScholarDigital Library
- Paul N. Hilfinger. 2019. Lecture 22: Type Inference and Uni-fication. https://inst.eecs.berkeley.edu/~cs164/sp11/lectures/ lecture22.pdfGoogle Scholar
- Eli Bendersky. 2018. Unification - Eli Bendersky's website. https://eli.thegreenplace.net/2018/unification.Google Scholar
- Peter Norvig. 1991. Correcting a widespread error in unifi-cation algorithms. Software: Practice and Experience 21, 2 (1991), 231--233.Google ScholarDigital Library
- Michael S Paterson and Mark N Wegman. 1978. Linear unification. J. Comput. System Sci. 16, 2 (1978), 158--167.Google ScholarCross Ref
- J Alan Robinson. 1971. Computational logic: The unification computation. Machine intelligence 6 (1971), 63--72Google Scholar
Index Terms
- A Novel Type-based API Search Engine for Open Source Elm Packages
Recommendations
Searching API usage examples in code repositories with sourcerer API search
SUITE '10: Proceedings of 2010 ICSE Workshop on Search-driven Development: Users, Infrastructure, Tools and EvaluationWe present Sourcerer API Search (SAS), a search interface to find API usage examples in large code repositories. SAS facilitates finding API usage examples by providing three unique features: (i) code snippets view for each result that shows the ...
APIBook: an effective approach for finding APIs
Internetware '16: Proceedings of the 8th Asia-Pacific Symposium on InternetwareSoftware libraries have become more and more complex in recent years. Developers usually have to rely on search engines to find API documents and then select suitable APIs to do relevant development when working on unfamiliar functions. However, the ...
Scaps: type-directed API search for Scala
SCALA 2016: Proceedings of the 2016 7th ACM SIGPLAN Symposium on ScalaType-directed API search, using queries composed of both keywords and type signatures to retrieve definitions from APIs, are popular in the functional programming community. This search technique allows programmers to easily navigate complex and large ...
Comments