NIX Solutions: Google Announced New Programming Language

Google Corporation often surprises with new projects. First we got the operating system Fuchsia, and now – a new declarative logic programming language Logica. According to the developers, it is designed to manipulate data and translate programs into the SQL language.

Logica is neccesary for developers who plan to use logic programming syntax to write queries to the database, states Souclou. There is already experimental support for executing the resulting SQL code in Google BigQuery storage or in PostgreSQL and SQLite DBMS. How else can a new language make developers happy?

In fact, Logica is a continuation of the development of another data processing language called Yedalog. It is also designed to provide a level of abstraction not available in native SQL. The language is called logical because the queries in Logica are programmed in the form of a set of logical statements.

It supports modules, imports, and the ability to run Logica right from the Jupyter Notebook interactive shell. A practical example is the formation of a sample of persons and names that were mentioned most often in 2020. The Logica program for accessing the GDELT database will look like this:

@OrderBy (Mentions, “mentions desc”);
Limit (Mentions, 10);
Mentions (person :, mentions? + = 1) distinct: –
gdelt-bq.gdeltv2.gkg (persons :, date :),
Substr (ToString (date), 0, 4) == “2020”,
the_persons == Split (persons, “;”),
person in the_persons;

$ logica mentions.l run Mentions
+ —————- + —————- +
| person | mentions_count |
+ —————- + —————- +
| donald trump | 3077130 |
| los angeles | 1078412 |
| joe biden | 1054827 |
| george floyd | 872919 |
| boris johnson | 674786 |
| barack obama | 438181 |
| vladimir putin | 410587 |
| bernie sanders | 387383 |
| andrew cuomo | 345462 |
| las vegas | 325487 |
+ —————- + —————- +

The developers of the language say they decided to create it to make life easier for everyone who works with SQL, reports VC. The problem is that complex SQL queries can be very long and multi-line. Moreover, the content of such requests is not obvious for perception.

NIX Solutions explains, that for typical repetitive calculations, SQL has the ability to work with views and functions, but, unfortunately, they do not support imports, nor do they provide the flexibility that high-level languages ​​have. For example, it is impossible to pass a function to a function here.

Logica, on the other hand, provides the ability to build programs from small, understandable, and reusable logical blocks. They can be tested and associated with specific names, and then grouped into packages available for use as part of other projects.

The developers have already completed a tutorial to familiarize themselves with the main functions and advantages of the new programming language.