AI

How I Wrote an AI Programming Language

By Devesh April 14, 2025 5 min read
AI Programming Language Concept

When I was in school learning programming, I realized something important: programming is purely about logic. The syntax — all those rules we memorize from books — is just structure. But I forgot this back then. I focused too much on memorizing syntax and learning all the rules.

Let me first explain how a programming language like Python, C++, Ruby, etc., actually works. When you write code in a code editor, there's something called an interpreter or a compiler that converts your code into machine-level language — the language that computers can understand. Because obviously, your code in English-like syntax doesn't mean anything to a computer. So this conversion is the key part of how programming works.

Recently, I had an idea: What if we could use AI as an interpreter or compiler to convert natural language into machine-level code? That way, we could code just with logic — without needing to learn any syntax at all.

But here's the catch: humans can write logic in many different ways. For example, someone might say:

analyze data.csv

But someone else might write:

Read data.csv

Both mean similar things, but the variations are endless. That's where it gets tricky. Traditional compilers work with strict, prewritten rules. But if we allow people to write code the way they think, converting that into machine-level code becomes hard — but not impossible (and yes, I'll keep working on this).

Here's the good news: I did figure out a way forward.

We can first convert the human logic into actual code syntax (like Python or C++), and then let traditional compilers convert that into machine-level language.

So the flow becomes:

Logic → (AI interpreter/compiler) → Code → (traditional interpreter/compiler) → Machine language

This method lets users write programs using just their logic. It's not perfect — especially for long codes or servers — but it's a great way to teach logic, data analysis, and more.

Here's an Example Code from DevScript:

analyse accident_prediction_india.csv plot a pie chart according to the number of accidents to the "Day of Week" use red color to indicate most number of accidents save it to week.jpeg
Pie chart of accidents by day of week

You can try out DevScript (it's free!) from my GitHub:

👉 https://github.com/ibedevesh/devScript/