MongoDB Engineering Journal Looks at Transpiling
The latest publication on the MongoDB Engineering Journal is "Transpiling Between Any Programming Languages - Part 1".
A lot of work done in developing MongoDB software goes into elements that truly enhance the experience of using it, while tending to be almost invisible to the user. Take MongoDB Compass, the GUI for MongoDB, and its ability to turn queries and aggregations into code for an expanding range of languages. This is possible because of a transpiler - a source to source compiler - running behind the scenes of the Compass client.
In the MongoDB Engineering Journal, the team behind this functionality dive in to explain how it is implemented and how the open source code powering it can be used. The Compass BSON transpiler is capable of taking in MongoDB Shell, JavaScript and Python code and emitting Java, C#, Python, MongoDB Shell and JavaScript.
The article takes a step by step look at the process of parsing, creating trees, transforming and processing those trees and then generating the code. The code itself is available as a standalone Node.js module, bson-transpilers
, and its advanced features - wider syntax support through symbol tables and a full BSON library - will be examined in a forthcoming article on the subject.
The MongoDB Engineering Journal is a tech blog for builders, by builder. It is dedicated to in-depth examination and explanation of the development work and issues that arise as the engineering team innovate, enhance and extend what it means to work with modern data.