Show HN: Preql – a database query language that compiles to SQL
github.com
github.com
I chose a unique approach, which is to create a new programming language, that compiles to SQL. That way, it could access all of the good that SQL has to offer (and there is plenty), but with all the features of a modern language, and without the design limitations of ORMs. It allowed me to add sorely missed features like first-class functions, modules, and type safety.
I built Preql in Python, which allows for a very smooth interface between the two. For parsing, I used a library called Lark, which I created three years ago. I also created a new library called Runtype, which proved very helpful for writing the compiler.
While Preql is still in its early stages, I'm very proud of what I've accomplished so far, and I hope you'll decide to take it out for a spin.
There are many worthwhile GUI tools for data analysis, which stand on their own. But perhaps they could benefit from having an embedded Preql console.
Also I like the syntax for defining the schema - it reminds me of GraphQL.
I'm not sure it's actually a risk. The improvements to optimization in C compilers have benefitted everyone, though it took C a long while to be better at it than humans. I think the same idea applies here, as long as we choose our abstractions and optimizations carefully.
> it reminds me of GraphQL
Good catch, GraphQL has been one of my inspirations.