liveBook · Manning

Natural language

As explained in Learn AI-Assisted Python Programming, Second Edition

A natural language is a human language that arises through ordinary human communication rather than being designed primarily for programming computers.

Natural language is ordinary human communication, such as English, rather than a computer language designed around exact programming rules. It is the preferred way for people to communicate with computers, although computers have traditionally required programming languages. section 1.1.1

Natural language differs from programming languages in several practical ways:

  • It is closer to everyday communication than assembly language or Python. section 1.1.1
  • It does not provide the exact rules and specified behavior required by a programming-language compiler. section 12.2.2
  • An LLM may interpret the same natural-language request differently, producing variable or incorrect results. section 12.2.2

From a number-printing task to a precise program

A person can describe the goal as printing the numbers 0 through 9. Python expresses that goal with range(0,10), while range(0, 9) stops before 9 and prints only 0 through 8. Natural language makes the intention accessible, but the generated or selected code still requires checking. section 1.1.1

for num in range(0, 9): 
     print(num)

Inspect the short Python listing that demonstrates how a small rule difference changes the requested output. section 1.1.1

How Learn AI-Assisted Python Programming, Second Edition covers it

How deep it goes
Contrasts natural language with programming languages and explains ambiguity, variability, and errors without detailing language-model internals.
Examples
Uses a Python range example that intends to print 0 through 9 but instead prints 0 through 8.
What it assumes
Requires no prior Python knowledge to recognize the intended task, while relying on basic familiarity with English or another natural language.
What you can do after
Evaluate/understand why natural-language requests can simplify computer interaction yet still require checking generated code.
How it connects
Connects natural language with English, Python, assembly language, programming languages, compilers, and large language models.

Also explained in

Compare how 5 books explain natural language →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn AI-Assisted Python Programming, Second Edition. The section links point to the parts of the book it draws on.