Programming Languages and Computer Languages

published

Humans write code for other humans to read, not for computers to run. Computers could just write code for computers to run.

Humans build software collaboratively. We need to be able to understand a system someone else worked on so we can modify it. Our programming practices and paradigms have evolved from this need of Human-Human coherence. But is Human-Human coherence a worthy goal in software engineering anymore? Maybe determinism (the system behaves exactly as you describe) is more important than legibility (you can read or decipher the system)?

Let me explain...


Human-Human and Human-Computer Coherence

Natural language is naturally imprecise. Words have meaning based on intention, culture, history, context, perception, and so much more. Humans think in natural language. At some point, ideas get converted from natural language into programmable abstracts. These abstracts are eventually converted into code in some high order programming language (Python, C, C++, R, Javascript, etc, etc).

The goals of popular higher order programming languages is to:

  1. Allow expression of intent
  2. Simplify human understandability of intent
  3. Efficiently and honestly interpret and compile to something that can execute in a runtime

Keep these in mind, as we will keep referencing them for the rest of this post.

For example, the most fundamental concept in software development is the Conditional (if...else).

if this is true:
    then do that
else:
    do some other thing

Pretty simple with one variable and one case to check for. What if there are multiple cases? You can do the same thing with if...else statements, or use a switch...case statement. Its slightly cleaner:

switch (dayNumber)
{
    case dayNumber>0 && dayNumber<=5:
        dayType = "Weekday";
        break;
    case 6:
    case 7:
        dayType = "Weekend";
    	break;
    default:
        dayType = "Invalid day";
}

Now, if you are a programmer who has to deal with 5 booleans and 32 cases, your logic training would kick in. You would likely make a truth table and find all the common cases then write nice switches (or conditionals) using DeMorgan's Law and god knows what other Computer Science witchery to try and get a simple representation of your conditional. Throw a few more variables (maybe some enums) in there and now we are talking functions and subfunctions, maybe a class or two and some deskside conversations to get a perfectly crafted, minimally verbose representation of this business use case. And then you write code like this...

// This logistics example models how five operational factors—weather conditions,
// traffic levels, driver experience, route complexity, and vehicle type—combine
// to determine delivery performance outcomes (Excellent, Good, Fair, or Poor).


function getDeliveryPerformanceHierarchical(weather, traffic, experience, route, vehicle) {
  // Define scoring system for each factor
  const scores = {
    weather: weather === 'Clear' ? 2 : 0,
    traffic: traffic === 'Light' ? 2 : 0,
    experience: experience === 'Experienced' ? 2 : 0,
    route: route === 'Simple' ? 1 : 0,
    vehicle: {
      'Van': 2,
      'Truck': 1,
      'Motorcycle': 1,
      'Bike': 0
    }[vehicle]
  };

  // Calculate total score
  const totalScore = scores.weather + scores.traffic + scores.experience +
                    scores.route + scores.vehicle;

  // Map score ranges to performance levels
  if (totalScore >= 7) return 'Excellent';
  if (totalScore >= 5) return 'Good';
  if (totalScore >= 3) return 'Fair';
  return 'Poor';
}

// Most concise version using mathematical approach
function getDeliveryPerformanceCompact(weather, traffic, experience, route, vehicle) {
  const w = weather === 'Clear' ? 3 : 0;
  const t = traffic === 'Light' ? 2 : 0;
  const e = experience === 'Experienced' ? 2 : 0;
  const r = route === 'Simple' ? 1 : 0;
  const v = {'Van': 3, 'Truck': 2, 'Motorcycle': 2, 'Bike': 1}[vehicle];

  const score = w + t + e + r + v;
  return ['Poor', 'Poor', 'Poor', 'Fair', 'Fair', 'Good', 'Good', 'Excellent', 'Excellent', 'Excellent', 'Excellent'][Math.min(score, 10)];

This is the process by which programmers 1. express intent.

Why does this look complicated? Well, because no human has the time to sit and account for thousands (or millions) of possible permutations. Quite simply, we are bound by typing speed. So we take logical shortcuts. Then we program the final conclusion of our logical evaluation into a computer. With minimal and scattered record of how or why we reached those conclusions.

Then, when bugs arise (because of unsound logical conclusions or linguistic misunderstanding) or when a new use case arises (because of ideation or the changing world around us), a human has to understand the complex logic (2. human understandability) and make changes to it. This is Human-Human coherence.

We impose understandability on code for human legibility, and then have to 3. interpret code for computer runnability. This is not deterministic! The more complex the system you are trying to explain to a computer in human-readable terms, the more interpretation the computer has to do. This is Human-Computer coherence.

Computers do exactly what we tell them to do. Bugs arise because our instructions were imprecise. Because translating natural language to a high order programming language and then to machine language is an imperfect process.


Computer-Computer Coherence and Computer Languages

Lets introduce a programming agent into the mix. In the example of the switch...case above, the agent could just list out all the possible cases and outcomes without any complex logic statements. Computers aren't bound by typing speed and should use that to their advantage. This 1. expression of intent would be more correct and less prone to bugs.

For the logistics problem above, that would look something like this. (Too long to include in the post directly)

Besides, having a separate condition for each possible condition would be more coherent for humans than needing to work back from concise logic statements. Leading to better 2. human understandability. It would be faster to change the behavior of the appropriate cases rather than redoing the logic tree.

This is still a lens of Computer-Human coherence, though. The computer is writing code for humans to understand. So lets make the final leap...

What if we drop 2. human understandability as a requirement and focus only on 1. expression and 3. interpretability? What if computers just have to write code for computers to run? They may drop our programming languages altogether and write machine code directly, or create a more efficient language for completing the task. This removal of the human legibility creates Computer-Computer coherence.

This is a Computer Language. A language computers use to talk with other computers without need for human legibility.

Computers process instructions in machine code and then translate this machine code to natural language so that they can communicate with humans. This need to translate back and forth makes the system inefficient and non-deterministic.

So why don't computers aim for Computer-Computer Coherence?

  1. LLMs are good at reproducing patterns they have seen. Because the gestalt of code they have been trained on is Human-Human coherent, those are the patterns programming models end up recreating. Even if they are not the most efficient patterns. Even if there is a better way. And my guess is that models are not being trained/instructed to think of Computer-Computer Coherence.

  2. Further, humans are less likely to approve AI code that is not human coherent. This means real-world Reinforcement Learning from Human Feedback (RLHF) is also encouraging LLMs to write human readable code.

  3. It's really scary to let computers write human unreadable code. It is scary to not have total transparency. Besides the models just getting good at Computer-Computer Coherence, we also have to consider people's appetite for such technology.


Human Role in a Computer-Computer Coherent World

No doubt, some people are already working on this.

Mainstream Computer-Computer coherence is not imminent. Computers are pretty bad at building complex computer systems by themselves. They are certainly not good at doing it without extensive instruction and feedback. Human legibility and editability of computer systems (and code) is still profoundly valuable. If this is to become mainstream, a Computers' ability to honestly and clearly articulate its internal logic in human terms is going to be important.

The shift from code-based development to prompt-based development seems likely. As this happens, computers will take responsibility for 1. expression and 3. interpretability in the most efficient and deterministic manner possible for them. The 2. human understandability phase is where the translation from computer language to human language will happen, but this is not going to be critical for the system to run.

This post is not advocacy, it is a thought experiment.