4 ms·
I wrote such a C++ implementation during my days at Facebook around 8 years ago: https://engineering.fb.com/2016/03/18/data-infrastructure/dragon-a-distributed
by adsharma 6y ago
I wrote such a C++ implementation during my days at Facebook around 8 years ago:
https://engineering.fb.com/2016/03/18/data-infrastructure/dragon-a-distributed-graph-query-engine/ https://engineering.fb.com/2016/03/18/data-infrastructure/dr...
There is an example under "Functional programming primitives".
It was a C++ implementation that fell victim to Greenspun's 10th rule. So I wrote a specification for it, first in Clojure and then in python.
The C++ execution engine is open source:
https://github.com/facebookarchive/iterlib/ https://github.com/facebookarchive/iterlib/
Main problems writing such code:
* The output of SQL is generally flat. GraphQL makes it nested, but doesn't support all the operators SQL does natively.
* Anyone trying to implement such an engine needs to ensure a fundamental property - the shape of the output can be inferred from the shape of the query.
* Writing async code in C++ with futures and promises is like pulling teeth. At some point the complexity explodes and the code becomes unmaintainable.
My most recent attempt is here:
https://adsharma.github.io/fquery/ https://adsharma.github.io/fquery/
It shouldn't be hard to put a wrapper around fquery that looks like the query string you present above. In fact, there is a s-expression parser in iterlib/python above that could be tweaked to do this.
I'm hoping that we can build a community around such languages and once the specification is agreed on, a more performant implementation can be written in a systems programming language.