Scott Stephens Scott Stephens

Introducing Grammar DB

I have been thinking and tinkering with this idea for a long time. It came from working with NodeJS and Rails spin-off languages, like coffeescript, babel, pug, slim, etc. I liked those languages, but using them often means you have to sell out to whatever platform wrote them, or look for some variant in your platform.

I wanted to be able to say, “I want to use a pug template”, (indent-oriented HTML markup), but not have to install the NodeJS compiler which generates code in Javascript. I might want to use it from Python or Go or some other language. There are ports to different languages, but they don’t always work as expected. I know building parsers takes a lot of time and effort to work correctly. Then I realized that language definitions are pretty language-independent, so I should be able to generate code for a parser in each language based on that definition.

I’ve tinkered around with architecture and am getting close to something that works. I thought of writing the language specifications into a data representation that can deal with inheritance and has enough information to generate working parsers. I also thought this could be used to generate specifications for languages for editors, like Atom, Visual Studio, Unstructured, or even generate Javascript web page editors for that language.

logo3a.svg.png
Read More