Home / Companies / Sanity / Blog / Post Details
Content Deep Dive

Introducing Glush: a robust, human readable, top-down parser compiler

Blog post from Sanity

Post Details
Company
Date Published
Author
Magnus Holm
Word Count
8,672
Language
English
Hacker News Points
-
Summary

Glush is a new parser toolkit designed to create efficient parsers in multiple languages like JavaScript, Go, and Ruby using a declarative and expressive grammar format. It aims to support a wide range of grammar features with best-in-class performance and was developed as part of an initiative to make the GROQ query language, used for querying JSON data at Sanity.io, open-source. The need for a new parser arose from the limitations of existing tools and the desire to avoid proprietary lock-in while ensuring a human-readable specification that is executable. Glush is built on the principles of Glushkov’s construction algorithm, which allows for recursive rule calls and maintains reliable performance even for complex grammars. Although still a work-in-progress, Glush represents an effort to advance parsing technology by building on decades of computer science research and aims to be adaptable for use across various programming languages and platforms.