AIによって、プログラマーが淘汰されようかという今になって「次世代のプログラミング言語とは何を言っているのか?」と返されそうですが、今とあるプロジェクトをやっておりまして(具体的なことは控えます)、AI時代に必要なプログラミング言語についてより意識するようになってきました。
今までのプログラミングとは「人間からコンピューターへの指示」ということでした。ではAI時代になると何が変わるのでしょうか。
現状、AIを使ったプログラミングは次のような形になります。
人間 → [自然言語(プロンプト)] → AI → [プログラム] → コンピュータ
これについてまず考えられるのは、次のような形です。
人間 → [次世代言語] → AI → [プログラム] → コンピュータ
つまり、人間とAIの間に共通言語を持てないか、という発想です。
さらにいうと、
人間 → [次世代言語] → AI → [次世代言語] → コンピュータ
ここまで踏み込めれば、AIが生成した内容も(原理的に)人間が確認可能になります。
つまり、問題が発生したときに「何が意図されていたのか」を追跡できるようになります。
ここで当然、次のような批判が出てきます。
人間 → [次世代言語] → AI
AI → [次世代言語] → コンピュータ
同じ言語を使うのであれば、AIは人間が入力した内容をそのまま返すだけではないか、というものです。
実際に、そういうことは起こり得るでしょう。
ポイントは、人間・AI・コンピュータの間で共通言語を持つこと自体にあります。
自然言語ではなく、このような言語を想定する理由は以下のとおりです。
一方で、従来のプログラミング言語との違いは、
にあると考えています。
このアイデアは一見すると突飛に見えるかもしれませんが、実は全く新しいものではありません。
第5世代コンピュータで目指されていた、論理型言語の思想に近いものです。
論理型言語の代表格であるPrologは、当時日本でも注目されました。
また、このブログでたびたび触れているADPも、Prologをベースとしています。
Prologのような言語は「宣言的」と呼ばれます。
つまり、
という考え方です。
現在のAIによるコーディングもこれに近く、人間が「何を作るのか」をプロンプトで与え、「どう作るか」はAIが担っています。
この役割分担を前提とすると、
「AIは入力をそのまま返すだけではないか」
という批判にも、ある程度対応できます。
もう少し踏み込んだイメージとしては、
という形です。
ここでいう「述語」は論理型言語の用語で、「関数」に近い概念です。
処理手順ではなく「満たすべき条件」を中心に表現することで、結果の妥当性を人間が確認しやすくなります。
とはいえ、このような構想は「言うは簡単で実現は難しい」ものです。第5世代コンピュータプロジェクト自体が頓挫した経緯もあり、AIを使えば当時の問題は解決できるのか?という問いは依然として残ります。
具体的には、
・人間に読みやすいと言ってもPrologはコンピュータよりの言語である。
・宣言的といっても、それだけですべてが上手くいくわけではない。Prolog自体が流行っていない。
・現実案としては、コメントがAIに対する補足(プロンプト)になるが、そうすると自然言語が残ることになる。
というジレンマがあります。特に「宣言的プログラミング」とは当時一瞬流行ったパラダイムになりますが、あまりこれを追求すると現実的でなくなるということがあります。またAIの出力は手続き的にもなりえます。このあたりの折り合いをどうつけるのかというのが課題かと思います。
もっとも、私自身も30年ほど前にこうしたアイデアの断片を考えたことがあります。
さらにいうと、ADPの機能として次世代言語に必要な要件を備えることができれば、ADPそのものが次世代言語になり得るのではないか、とも思っています。
夢は広がりますが、まずは時間を見つけて少しずつ形にしていきたいところです。
■ The Structure of AI-Assisted Programming Today
Traditionally, programming languages have been a way for humans to instruct computers. So what changes in the AI era?
Today, AI-assisted programming typically looks like this:
Human → [Natural Language (Prompt)] → AI → [Program] → Computer
From here, one natural idea is:
Human → [Next-Generation Language] → AI → [Program] → Computer
In other words, can we introduce a shared language between humans and AI?
Taking this a step further:
Human → [Next-Generation Language] → AI → [Next-Generation Language] → Computer
If this were possible, then—even in principle—humans could verify what the AI produces.
When problems occur, we could trace and understand the original intent behind the system.
At this point, a natural criticism arises:
Human → [Next-Generation Language] → AI
AI → [Next-Generation Language] → Computer
If the same language is used on both sides, wouldn’t AI simply return what the human provided?
In fact, this can certainly happen.
The key point is the value of having a shared language across humans, AI, and computers.
Why not just use natural language?
A next-generation language would instead aim to:
And compared to traditional programming languages, the key difference would be:
This idea may sound radical, but it is not entirely new.
It is closely related to the concepts explored in logic programming languages during the Fifth Generation Computer era.
For example, Prolog—one of the most well-known logic programming languages—was once widely discussed in Japan.
The language I’ve mentioned occasionally in this blog, ADP, is also based on Prolog.
Languages like Prolog are often described as declarative.
That means:
Interestingly, modern AI-assisted coding follows a similar pattern:
humans specify what they want, and AI handles how to implement it.
If we properly recognize this division of roles, we can respond to the earlier criticism that “AI would just return the input as-is.”
A more concrete idea would be:
Here, a “predicate” is a concept from logic programming, somewhat similar to a function.
Instead of describing step-by-step procedures, we describe conditions to be satisfied.
This makes it easier for humans to verify whether the result is correct.
Of course, this kind of idea is much easier said than done.
The Fifth Generation Computer project itself failed, which raises the question:
Can AI solve the challenges that existed back then?
More concretely, several dilemmas remain:
This creates a fundamental tension.
Declarative programming was once a briefly popular paradigm, but pushing it too far can make systems impractical.
At the same time, AI-generated output can also be procedural.
How to balance these aspects remains an open challenge.
That said, I personally had fragments of this idea over 30 years ago.
And if the language I’m developing—ADP—can incorporate the necessary characteristics of such a next-generation language, it might itself become one.
It’s an ambitious thought, but for now, I’ll continue working on it little by little, whenever time allows.