Watch on YouTube
2020-10-12

In this video I'll be walking you through how to build a mapping language in Go using parser combinators, starting from the basics and working our way up towards the higher level grammar.

This was a relatively conflicted point in my career. I had been working at the time as a contractor for the company Timber, where I was working on the open source logging tool Vector.dev.

I essentially had two jobs; one was helping to design and develop the future of Vector, and the other was to continue growing and supporting my own open source project Benthos. The two projects were extremely similar even though they targeted different markets (moving streamed data) and I had enough experience with Benthos (the more mature product) to know that a good mapping language would be a monumental feature.

However, there wasn't any interest in the Vector project for a new language at this time. The general conversations being had were that it was an outlandish effort to design and build a mapping language and it would be difficult to support. Instead, I decided to implement the new mapping language Bloblang in my spare time on the Benthos project. This would both serve as the mapping language in Benthos and also be a proof of concept for Vector.

It still took a few months of seeing Bloblang succeed in the wild before I was allowed to write up an RFC for Vectors new mapping language. Once it was approved I put together the first iteration of it, and within the space of six months I'd designed and built a brand new mapping language in two completely different projects. One in Go, the other in Rust.

This video covers the details of Bloblang, written in Go for Benthos. Which, in my opinion (far removed from emotional attachment at this point), is the better language.