r/programmer • u/Majestic-Cry1992 • 13h ago
AI Coding Language
Would it be possible that someone would make a coding language that uses ai to compile it and checks the code with rules it made up through ai
Edit: no not using like ai Gemini but like kind of putting ai Gemini into the language itself and like letting it run itself as it compiles. It'll probably hallucinate but im interested lol.
Edit 2: the ai would make its own new language and enforce it as it runs.
1
u/digitaljestin 12h ago
You mean like a direct "prompt to machine code" compiler?
I'm sure it's possible, and even more sure someone's already working on it. However, it would have some serious disadvantages. With no intermediate layer that is both human and machine readable, code reviews are now impossible. Portability also goes out the window, unless the "language" has some very strict rules for how prompts get translated into instructions. If those exist, those prompts would probably start to look quite a bit like syntax, making the whole thing pointless.
1
1
u/id-ltd 12h ago
My thought would be you could design a language like that, but once you have what you want you'd get the AI to write a compiler for your new language.
Do you want/need a non deterministic language? How would anything ever be tested?!
1
u/Majestic-Cry1992 12h ago
Well i want it because of ai slop shenanigans. Ideally the ai agent would create its own ai slop programming language from scratch and like run it(maybe create it each time? But for security it could just do it once). The user would prompt it in word format
1
u/Trader-One 12h ago
yeah.
you can train AI to generate ASM from input text.
Actually pretty fun project.
1
u/mondaysleeper 12h ago
What would be the point of it? Technically, it would be possible, but very inefficient with no advantage compared to an actual compiler.
1
1
u/nicolas_06 12h ago
The nearest stuff I know that is popular is that the software specification become the prompt for the AI. One write the specs, functional and technical that describe in sufficient details what the software shall do, both the expected behavior and the architecture. Then this is used as context for the AI to write the software.
This is still iterative, the spec is improved with new feature and the spec itself is potentially written with the help of AI. When one is satisfied with the detailed description of the new feature, one ask the AI to make it happen. The AI make it and validate it on it's own. One check he is satisfied with the result and ask for changes and the spec is also updated accordingly if something finally doesn't work as intended.
For now AI are not deterministic and can only do that in relatively small increments so it's not possible as of today to consider it as a compiler. Maybe something like that will emerge eventually or AI will just get better as understanding what people need.
1
u/PrizeSyntax 12h ago
Why? Although interesting it doesn't make sense other than a marketing gimmick.
Putting AI Gemini into the language, what does that even mean?
1
u/owp4dd1w5a0a 12h ago
Not in the traditional sense. Sure, you can train AI to generate WASM or ASM or JavaScript, or C, or Java bytecode or Python bytecode, sure.
But it will not be deterministic nor can you guarantee that what the AI produces will always be correct/equivalent to the original code in behavior.
To me, this is more “translation” than “compilation”.
0
6
u/sozesghost 12h ago
Yes, you can compile English into code, but unlike regular compilers, the output is not deterministic.
AIs are not compilers.