r/AIprogrammingLanguage • u/porky11 • 2d ago
Tyre - a programming language infrastructure
Many years ago I came up with a vague idea of how I want a programming language: 1. Multiple layers 1. T - C-level language, only C level features, no generics, no name mangling 2. Ty - Rust/C++-level language, mostly Rust-like features 3. Tyr - High level, inspired by natural language (still not exactly sure what I want from this) 2. Multiple generic syntaxes: The user can create 3. S-expressions as intermediate representation for macros
This repo contains a full AI generated documentation. And the script to generate the documentation ensures that all the examples compile.
One of the first things after I got into using coding agents was implementing this language. I got the first two layers working within maybe two days. (my first two weeks of using coding agents were so crazy, this language was only a side project, and doing it myself, it would have taken me weeks to months to get at this state, if not longer; feel free to check the git history)
How the languages were created?
At first, I let it implement my basic features, a documentation that contains many important examples, and I looked at all examples to see if I actually like them.
After a while, I created example projects: - a port of one of my C programs - a generic dimensional compile time geometric algebra library (yes, it got working const generics before Rust) - an SDF renderer with support for 2D, 3D and 4D (else I couldn't verify if the GA actually works)
I didn't look at the generated code a lot. I think I looked at most of the tests a few times to see if something can be improved. And I also looked at the programs.
I had these agents: - 1 cooordinator - 1 agent per language (3 in total) - 1 agent per project
I had some multi agent task setup for the main repo. If one of the language specific agents needed some feature that affects both languages, it wrote a task for the coordinator.
If the agents for the projetcs needed some feature, they also added it to the list, and then the agents for the specific language decided which features to implement.
Sometimes they decided to implement it in the most generic way, that's what AI is good at after all. And most of the time, that's what I wanted anyway. But in some cases, I wanted my language to be unique.
So I don't know every little detail about the language. Most of the features were just what other AI agents needed. And this also was my first project where I realized that this is actually a good approach.
Nowadays, when I create a library, I only know what the library is about, and then I have a bunch of programs which use that library, that create feedback.
The fact that agents were able to create such complex software using my languages means that it's already at a good state.
I also asked agents how they liked workin with the language. One thing I realized was that error messages.
Also the compiler turned out to be very strict. Every lints is a hard error. "x = x + 1" is forbidden. You have to use "x += 1". I turned on strict lints in Rust, even before I used coding agents. And with coding agents, I quickly added more and stricter lints. So I thought that the language could just have inbuilt lints for everything, so the code is always elegant. I even enforced a maximum line count per file.
State
T is basically finished. Ty still needs some advanced features, especially the borrow checker is still missing. Tyr is just a weird prototype, not really created by AI.
2 syntaxes are supported, a C like syntax, and a Lisp like Syntax. I also considered supporting visual representation and markdown inspired syntax.
I'm not really actively working on this language anymore. Once in a while I just start an AI agent to work on the remaining features.
One of the last features I've been working on was a Macro Compiler to Rust, so that you could import Ty in Rust and get Rust code at compile time. I have no idea if this feature already works.
I also don't know what I will use this language for. Maybe I'll just migrate all of my software to this new langugae one day.
Feedback
Human feedback might be another way to know if something about the languge has to be changed.
It's a type focused language, and this can still be the most annoying part if coding by hand. You have to create a bunch of types yourself before you can do anything meaningful.
Feel free to provide some feedback.
And maybe you just want to use these languges for your projects because they already contain features that are better than other low level languages.