Presented by

  • Anna Herlihy

    Anna Herlihy
    @annaisworking

    Anna Herlihy is a senior software engineer working for MongoDB in Stockholm. She is a contributor to PyMongo, MongoDB, bson-numpy, and a few other MongoDB Drivers but is working now on Compass, the GUI for MongoDB. She enjoys hiking, road biking, climbing, and is most happy when she can do her work outdoors.

Abstract

Compass, the UI for MongoDB, is an Electron app that allows developers to visually develop aggregations and queries for their database. Right now it accepts these queries in the MongoDB Shell syntax, a JavaScript-based query language. However, developers use a wide range of programming languages in their apps, and constant context switching between languages can be painful. To cure this pain, we wanted to allow users to export the queries they built in Compass into whatever programming language they wanted. Even better, we wanted to also allow users to write their favorite language directly into Compass. To achieve these goals, we needed a way to translate query syntax in any programming language into query syntax in any other language, so we needed to write a multi-language-input to multi-language-output transpiler in web-friendly JavaScript! Further, since MongoDB has so many diverse and passionate language communities, I really wanted the transpiler to be “pluggable” - community members should be able to add their favorite language to Compass without needing to be compiler experts or know about what other languages were implemented. It is not enough to simply open source the code and hope people contribute. The compiler was architected with distributed collaboration in mind from the very start, and this talk will describe all the steps we took to make the barrier to contribution as low as possible. This talk will go through the technical design of the anything-to-anything pluggable transpiler and teach attendees how they can add their own favorite language to Compass. I’ll talk about classic compiler design principles and how I leveraged various compiler technologies to create a dynamic, extensible transpiler. Lastly, I’ll talk about how we can take this transpiler and apply it to an abundance of other use cases! Who should attend? Anyone with an interest in open source, compilers, parsers, Compass, MongoDB, ANTLR, or a general passion for complex technical problems is welcome. I will talk about classic compiler design without requiring attendees to be programming-language experts, although any knowledge of compiler implementations will be useful. Attendees will leave the talk knowing exactly how to extend Compass to support new languages and will hopefully be inspired to go out and add their favorite language to Compass! Why should they attend? This talk addresses both MongoDB-specific challenges as well as highly technical computer science problems. Attendees will learn not only about Compass itself, but about compiler design. As developers we use compilers every day, but it is not so often that we get the opportunity to actually write them, and compilers are awesome!