Skip to content

AI needs programming languages

There is a temptation to predict that AI will negate the need for programming languages or compilers and will be able to output raw assembly.

"Programming languages are just for humans to read!"

But programming languages serve more than being just a human readable abstraction.

Raw assembly has no invariants, no syntactic structure, no enforced meaning and, most notably, no proof surface.

Raw LLM generated assembly would simply be a sequence of states; if it works, it's literally by accident.

Programming languages provide a deterministically verifiable layer.

AI is not a proof system.

LLM's are statistical machines.

Even super intelligence is/ will be non-deterministic.

A probability distribution cannot be relied upon for invariants.

So what is more likely?

~

There is another temptation to predict everything will be written in C/C++.

These are universal, statically-compiled, system level languages that would be perfect candidates for building long-lasting, high-quality software.

C++ can be written in a memory safe manor, and I have no doubt that super intelligence will be able to do so.

But C and C++ are not deterministically and verifiably memory safe, even if written by a super intelligence.

What is really needed is a statically compiled memory safe language.

~

Languages like Rust, by way of Type Theory and Affine Logic, are deterministically guaranteed to be memory safe.

Memory-safe languages are built on type systems that encode logical constraints about resource usage, and the compiler mechanically proves those constraints.

Rust is essentially a restricted logic system where “invalid memory access” is an unprovable statement.

Rust is not “a nicer C++”.

It’s a theorem prover with syntax.

The statement:

rust
let x = &y;

Asserts a logical proposition: “This reference is valid for this scope.”

The compiler attempts to prove it.

If it can’t, the program is rejected.

No amount of intelligence can bypass this.

This isn't a claim that Rust is the ultimate form of programming, but what it and its predecessors implement- deterministic memory safety without the use of garbage collection- will almost certainly be used and not circumvented by AI.

~

Programming languages are not obsolete interfaces for humans.

They provide formal constraint systems that turn probabilistic intelligence into deterministic behavior.

AI can generate code, but only type systems can guarantee invariants.