Paul Krill
Editor at Large

Google’s Logica language addresses SQL’s flaws

news
Apr 15, 20212 mins

Open source logic programming language compiles to SQL and runs on Google BigQuery, with experimental support for PostgreSQL and SQLite.

Conceptual image of an individual user working with an extruded virtual display.
Credit: Dean Mitchell / Getty Images

Google has unveiled the open source Logica programming language, a logic programming language designed to “solve problems of SQL” by using syntax of mathematical propositional logic rather than natural language.

Introduced on April 12 as a successor to Google’s Yedalog language, Logica is a Datalogic-like logic language. Meant for engineers, data scientists, and other specialists, it compiles code to SQL and runs on the Google BiqQuery cloud-based data warehouse, with experimental support for PostgreSQL and SQLite. But Logica is more concise and supports reusable abstractions unlike SQL. It also supports modules and imports, can be used from an interactive Python notebook, and makes testing queries easy and natural, Google developers wrote in a blog post.

Logica solves problems of SQL by using syntax of mathematical logic rather than natural English language. Google cited issues with SQL such as the verbosity of constructing statements from English words and limited support for abstraction. Logica extends classical logic programming syntax, notably with aggregation. It is billed as a declarative language for data manipulation.

The Google developers behind the Logica open source project encourage its use in the following scenarios:

  • Where logic programming is already being used but a user needs more computational power
  • Where SQL is being used but the user is not satisfied with its readability
  • Where developers want to learn logic programming and apply it to big data processing

Google has set up a tutorial to help developers learn Logica. To run logic programs on Google Cloud BigQuery, developers will need to open a Google Cloud Project. Once a project is established, developers can run Logica programs in Colab by providing a project ID. To run Logica locally, developers need Python 3.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author