Glossary term
What is natural language programming?
What is natural language programming?
Natural language programming is an ontology-assisted method of programming that uses natural language, such as English, to create a structured document that serves as a computer program. This approach is designed to be human-readable and can also be interpreted by a suitable machine.
The process of natural language programming involves several stages. First, an ontology or taxonomy of concepts needed to describe tasks in the topic addressed is defined. Each concept and its attributes are defined in natural-language words. This ontology defines the data structures the program can use in sentences. Then, one or more top-level sentences are defined in terms of concepts from the ontology.
Natural language programming is a niche technique, not a mainstream discipline: the best-known implementation is Inform 7, a language for writing interactive fiction in structured English sentences. It belongs to the broader family of controlled natural languages — restricted, unambiguous subsets of a language (English, in most examples) designed to be parsed deterministically, similar in spirit to Attempto Controlled English.
Natural language programming should not be abbreviated as NLP on this page, because NLP conventionally refers to natural language processing, a distinct and far more widely used branch of artificial intelligence.
How does natural language programming relate to prompt engineering?
Prompt engineering — designing effective instructions for large language models — is a related but separate practice from natural language programming. Both use natural-language text as an interface to a computer system, but prompt engineering targets a probabilistic model that infers intent from free-form text, while natural language programming targets a deterministic parser that expects sentences built from a defined ontology.
As LLMs increasingly serve as an interface between humans and software, techniques originally developed for natural language programming — defining vocabulary and structure up front so a system can interpret a sentence reliably — inform how teams constrain and structure prompts to get consistent output. Prompt engineering has its own well-documented challenges, including overfitting to narrow phrasing and the risk of prompts surfacing biases already present in a model's training data.
More terms
Continue exploring the glossary.
Glossary term
What is probabilistic programming?
It's time to build
Collaborate with your team on reliable Generative AI features.
Want expert guidance? Book a 1:1 onboarding session from your dashboard.