Formal and Natural LanguagesΒΆ

Formal languages tend to have strict rules about syntax. For example, 3+3=6 is a syntactically correct mathematical statement, but 3=+6$ is not. H2O is a syntactically correct chemical name, but 2Zz is not.

Although formal and natural languages have many features in common — tokens, structure, syntax, and semantics — there are many differences:

ambiguity
any statement has exactly one meaning, regardless of context.
redundancy
Natural languages are often verbose. Formal languages are less redundant and more concise.
literalness
Formal languages mean exactly what they say.

In some ways, the difference between formal and natural language is like the difference between poetry and prose, but more so:

poetry
Words are used for their sounds as well as for their meaning, and the whole poem together creates an effect or emotional response. Ambiguity is not only common but often deliberate.
prose
The literal meaning of words is more important, and the structure contributes more meaning. Prose is more amenable to analysis than poetry but still often ambiguous.
program
The meaning of a computer program is unambiguous and literal, and can be understood entirely by analysis of the tokens and structure.

Here are some suggestions for reading programs (and other formal languages).

Next Section - A Typical First Program