scala-search.github.io Find Scala functions by types and keywords.
Scaps: Type-Directed API Search for Scala
2016-10-30 at Scala Symposium
Preprint · Slides · Abstract...
Type-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 APIs in order to find the definitions they are interested in. While there exist some effective approaches to address type-directed API search for functional languages, we observed that none of these have been successfully adapted for use with statically-typed, object-oriented languages. The challenge here is incorporating large and unified inheritance hierarchies and the resulting prevalence of subtyping into an API retrieval model. We describe a new approach to API retrieval and provide an implementation thereof for the Scala language. Our evaluation with queries mined from Q&A websites shows that the model retrieves definitions from the Scala standard library with 94% of the relevant results in the top 10.
Scaps: Retrieving Values with Types
2016-02-11 at ScalaSphere
Slides · Abstract...
Scaps is a search engine for quickly discovering definitions in your Scala project and all its library dependencies. Like Hoogle for Haskell, it especially focuses on type queries that allows to precisely formulate questions like “How to get an X from a Y?”. Scaps incorporates almost all features of Scala’s type system to provide useful answers, including subtyping, higher-order polymorphism and implicit conversions.
In contrast to Haskell, the presence of inheritance hierarchies in Scala pose some surprising treats to either performance or precision of the search engine. This talk highlights some of those pitfalls and shows how they have been addressed in Scaps. Additionally, I want to give an outlook on the future of the project and how it can be adopted to further languages on the JVM.
Scaps: Type-Directed API Search for Scala (Master's Thesis)
2015-08-20 at IFS, HSR
Report · Abstract...
Reusing existing functionality from legacy code and third party programming libraries is often hard, because the vast number of definitions and the complexity of the APIs require a detailed knowledge of the programming environment. To help developers discovering such functionality when working with a statically typed, object-oriented programming language, we designed an API retrieval system that supports querying indexed APIs with textual keywords and type signatures. The feature of the search engine is inspired by a similar tool for the Haskell programming language called Hoogle. Though, we decided to develop another approach to address the API search problem based on traditional information retrieval techniques which, we argue, is better suited for object-oriented languages.
As a proof of concept, we implemented the API retrieval system for the Scala programming language and provided a web-based user interface. Furthermore, we demonstrate how Scala-specific language features like user-defined implicit conversions and implicit parameters can be included into our basic approach. A comparison to a system using only exact matches of partial types of the query shows that the effectiveness of API retrieval can be substantially improved with our approach.
Concepts for CDT
2015-01-31 at IFS, HSR
Report · Abstract...
Concepts is one of the most awaited language constructs of the C++17 standard and is going to simplify the work with templates significantly. The new language feature introduces a way to describe syntactical requirements for template parameters and check template arguments during instantiation. Requirements on template parameters are no longer only implied from their use in the template body. This enables cleaner error messages during compilation and more self-explanatory APIs. But, up to now there is only one working implementation of the current Concepts proposal as part of the GCC C++ compiler and the support in IDEs is non-existent.
During this term project, we have worked on the integration of the Concepts proposal in the Eclipse CDT development environment. We have analyzed the new language features and identified the required changes and extensions to both parser and semantic analysis.
The resulting implementation includes complete support for the new syntax introduced by the proposal. Furthermore, the binding resolution algorithm has been extended such that all names used for constraining template arguments and defining concepts can be correctly resolved and checked for binding errors. This gives basic support for the new language features and enables the further implementa- tion of more advanced features like concept checks in the IDE, constraint-based auto-completion and new refactoring tools.
Unobstrusive Refactoring Tools for Code Extraction in Scala
2014-01-27 at IFS, HSR
Report · Abstract...
While the support for automated refactoring for the Scala programming language increased steadily over the last few years, it is still not as elaborated as the tools available for other statically typed languages like Java or C#. The few refactoring tools provided by major Scala IDEs are heavily influenced by their Java equivalents and are not particularly tailored to the lightweight and expressive nature of Scala.
This project provides a set of new refactoring tools for code extraction that offer lightweight invocation methods and require minimal user interactions while still remaining flexible. The source transformation logic of the new tools has been implemented as a part of the Scala Refactoring library and is also integrated in the Scala IDE for Eclipse.
The new tools support the refactoring techniques Extract Method, Extract Value, Extract Parameter and a new refactoring called Extract Extractor that allows to create abstractions of patterns via Scala’s extractor syntax.