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.
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.
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.
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 →
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.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
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.