With the increasing complexity of software, it becomes even more important to build on the work of others. At the same time, websites, such as Stack Overflow or GitHub, are used by millions of developers to host their code, which could potentially be reused.
The process of finding the right code, however, is often time-consuming. In addition, the right solution may be written in a programming language that does not fit the developer’s requirements. Current approaches to automate code search allow users to search for code based on keywords and transformation rules, but they are limited to one programming language.
Our approach enables developers to find code written in different languages that can be reused in applications running in a polyglot runtime environment. In addition to conventional search filters, users can filter code by providing example input and expected output. Based on our approach, we have implemented a tool prototype in GraalSqueak. We evaluate both approach and prototype with an experience report.