Arrows to Arrows, Categories to Queries
Web page · https://reasonablypolymorphic.com/blog/arrows-to-arrows
First seen by Oriel on .
AI summary
The article introduces catlang, a programming language whose category-theoretic intermediate representation compiles programs into a single PostgreSQL SELECT statement.
- catlang is a programming language rather than a query language, with PostgreSQL serving as its compilation target.
- An example arrow uses looping, branching, arithmetic, and pattern-like sum handling to return 100 for any input.
- Its intermediate language has simple algebraic operators for composition, products, sums, projections, distribution, and recursive control flow.
- The compiler can transform this categorical intermediate representation into different domains, making alternative compilation targets possible.
- The generated SQL is extremely large, using nested queries, UNION operations, NULL-typed fields, and a WITH RECURSIVE recursion structure.
#category theory #sql #postgres #compilers
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Hacker News: 82, latest observation ; +78 over observed period since
- Lobsters: 8, latest observation ; +6 over observed period since
Comments
Comment count reported by the source.
- Hacker News: 7, latest observation ; +7 over observed period since
- Lobsters: 0, latest observation ; 0 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Hacker News | 50361107 | https://reasonablypolymorphic.com/blog/arrows-to-arrows/ Read discussion |
| Lobsters | gqis6q | https://reasonablypolymorphic.com/blog/arrows-to-arrows/ Read discussion |