← All stories
● Covered by 1 source · 1 reportLow impact1 neutral

Catlang: A New Programming Language Compiles to a Single SQL SELECT Statement

🔄 Updated 3d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Catlang compiles programs into one large SQL SELECT statement.
  • The language uses abstract category theory for its intermediary representation.
  • It supports constructs like loops, demonstrated with a function returning 100.
  • The compiler includes an arrow desugarer for its syntax.

Introduction to Catlang

Catlang is a newly developed programming language designed to compile directly into a single SQL SELECT statement. When this generated SQL query is executed in a PostgreSQL database, it produces the output of the original Catlang program. This approach differs from traditional query languages by treating SQL as a compilation target for a full programming language.

Motivation and Core Features

The primary motivation behind Catlang was to create a unique compilation target to test its core feature: an intermediary language built upon abstract category theory concepts. The language's syntax incorporates elements reminiscent of arrow notation, allowing for constructs such as loops and conditional logic within the program that are then translated into the SQL output.

Example: A Looping Function

An example function named 'count' demonstrates Catlang's capabilities. This function, which always returns 100 regardless of input, implements its logic using a loop construct. The loop iteratively modifies a variable 'n' until it reaches 100, showcasing how control flow is expressed in Catlang before its transformation into SQL.

Intermediary Language and Compilation

After desugaring the source code, Catlang programs are converted into an intermediary representation based on category theory. This abstract representation is then used to generate the final SQL SELECT statement. The compiler also includes an arrow desugarer, which processes the arrow-like syntax used in Catlang's source code.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 07

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Primary sources

GitHub isovector/catlang

Reporting from

A developer created Catlang, a new programming language that compiles its entire program logic into a single SQL SELECT statement, which then executes in PostgreSQL. This project serves as a testbed for the language's core feature: an intermediary language based on abstract category theory.