Google’s Logica promises to make data queries “fun”

Get a free Techzine subscription!

The new Logic Programming language is a successor to Google’s earlier Yedalog SQL.

The big brains at Google have decided that plain old Structured Query Language (SQL) is no good at scale, and leads to messy databases. Thus, they have gifted the world a new Logic Programming language to help keep databases clean and organized.

Logica is the name of the new language. Its code compiles to SQL and runs on Google BigQuery (with experimental support for PostgreSQL and SQLite).

Google software engineers Konstantin Tretyakov and Evgeny Skvortsov unveiled Logica this week in in a post to Google’s open source blog. They wasted no time in singing the praises of their new baby. Logica “is much more concise and supports the clean and reusable abstraction mechanisms that SQL lacks,’ they boast.

“It supports modules and imports, it can be used from an interactive Python notebook and it even makes testing your queries natural and easy.”

“Good programming is about creating small, understandable, reusable pieces of logic that can be tested, given names, and organized into packages which can later be used to construct more useful pieces of logic,” they explain. “SQL resists this workflow.”

This inherent resistance to decomposition of logic into bite-sized pieces is what leads into the contrived, lengthy queries, they say.

The solution to SQL’s failures

Tretyakov and Skvortsov propose using a new open source logic programming language called Logica. This new language extends classical Logic programming syntax further, most notably with aggregation, hence the name. Logica stands for Logic + Aggregation, they explain.

The two engineers then devote a large part of the blog post to explaining how Logica works, but exhort the reader to get involved in the open source development project – just for the fun of it.

“There is much more to Logica, so make sure you give it a try,” they gush, “chances are, you will love it!”