Is Code a Language?

Python, JavaScript, C. We call them programming languages. They have vocabulary, grammar (syntax) and rules for meaning.

But are they languages like English or Tamil?

Similarities:

  • Syntax: Rules for what counts as a well-formed statement.
  • Composition: Small parts combine into larger meaningful structures. (See Infinite Sentences From Finite Words.)
  • Communication: Programmers write code partly for other people to read and understand.

Differences:

  • No ambiguity allowed: Natural language thrives on context and implication. Code must be exact, or the computer fails. (See Ambiguity: When Words Mean Two Things.)
  • Instructions, not conversation: Most code tells a machine what to do. It doesn’t describe, ask or promise in the usual sense. (See How to Do Things With Words.)
  • Designed, not grown: Programming languages are invented deliberately; natural languages evolve over generations. (See Who Decides What Words Mean?)

Formal languages: Programming languages descend from formal languages in logic and mathematics, developed by thinkers like Frege, Russell and Turing, which aimed to remove the vagueness of everyday speech. (See Alan Turing: Can Machines Think?)

Can code be beautiful? Programmers often speak of “elegant” code, and the computer scientist Donald Knuth called programming an art. Some write poems in code. (See The Beauty of Mathematics.)

The future: As people instruct AI systems in natural language, the line between talking and programming blurs. (See Can Machines Understand Language?)

Your question

Is there a set of exact instructions you follow, like a recipe or routine? How is it different from how you talk to a friend?