What is natural language programming?

Stephen M. Walker II · Co-Founder / CEO

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.

Learn how teams define, measure, and improve LLM systems.

Glossary term

What is the belief-desire-intention (BDI) agent model?

The belief-desire-intention (BDI) software model is a computational model of the mind that is used in artificial intelligence (AI) research. The model is based on the belief-desire-intention (BDI) theory of mind, which is a psychological theory of how humans think and make decisions.
Read term

Glossary term

What is probabilistic programming?

Probabilistic programming is a programming paradigm designed to handle uncertainty by specifying probabilistic models and automating the process of inference within these models. It integrates traditional programming with probabilistic modeling, allowing for the creation of systems that can make decisions in uncertain environments. This paradigm is particularly useful in fields such as machine learning, where it can simplify complex statistical programming tasks that would traditionally require extensive code.
Read term

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.

Talk to sales