Jump to content

Natural language programming

From Wikipedia, the free encyclopedia

Natural language programming (NLP) is an ontology-assisted way of programming in terms of natural language sentences, e.g. English.[1] A structured document with Content, sections and subsections for explanations of sentences forms a NLP document, which is actually a computer program. Natural language programming is not to be mixed up with natural language interfacing or voice control where a program is first written and then communicated with through natural language using an interface added on. In NLP the functionality of a program is organised only for the definition of the meaning of sentences. For instance, NLP can be used to represent all the knowledge of an autonomous robot. Having done so, its tasks can be scripted by its users so that the robot can execute them autonomously while keeping to prescribed rules of behaviour as determined by the robot's user. Such robots are called transparent robots [2] as their reasoning is transparent to users and this develops trust in robots. Natural language use and natural language user interfaces include Inform 7, a natural programming language for making interactive fiction, Shakespeare, an esoteric natural programming language in the style of the plays of William Shakespeare, and Wolfram Alpha, a computational knowledge engine, using natural-language input.[citation needed] Some methods for program synthesis are based on natural-language programming.[3]

Interpretation

[edit]

The smallest unit of statement in NLP is a sentence. Each sentence is stated in terms of concepts from the underlying ontology, attributes in that ontology and named objects in capital letters. In an NLP text every sentence unambiguously compiles into a procedure call in the underlying high-level programming language such as MATLAB, Octave, SciLab, Python, etc.

Symbolic languages such as Wolfram Language are capable of interpreted processing of queries by sentences. This can allow interactive requests such as that implemented in Wolfram Alpha.[4][5] The difference between these and NLP is that the latter builds up a single program or a library of routines that are programmed through natural language sentences using an ontology that defines the available data structures in a high level programming language.

An example text from an English language natural language program is as follows:

If U_ is 'smc01-control', then do the following. Define surface weights Alpha as "[0.5, 0.5]". Initialise matrix Phi as a 'unit matrix'. Define J as the 'inertia matrix' of Spc01. Compute matrix J2 as the inverse of J. Compute position velocity error Ve and angular velocity error Oe from dynamical state X, guidance reference Xnow. Define the joint sliding surface G2 from the position velocity error Ve and angular velocity error Oe using the surface weights Alpha. Compute the smoothed sign function SG2 from the joint sliding surface G2 with sign threshold 0.01. Compute special dynamical force F from dynamical state X and surface weights Alpha. Compute control torque T and control force U from matrix J2, surface weights Alpha, special dynamical force F, smoothed sign function SG2. Finish conditional actions.

that defines a feedback control scheme using a sliding mode control method.

Software paradigm

[edit]

Natural-language programming is a top-down method of writing software. Its stages are as follows:

  • Definition of an ontology  taxonomy  of concepts needed to describe tasks in the topic addressed. Each concept and all their attributes are defined in natural-language words. This ontology will define the data structures the NLP can use in sentences.
  • Definition of one or more top-level sentences in terms of concepts from the ontology. These sentences are later used to invoke the most important activities in the topic.
  • Defining of each of the top-level sentences in terms of a sequence of sentences.
  • Defining each of the lower-level sentences in terms of other sentences or by a simple sentence of the form Execute code "...". where ... stands for a code in terms of the associated high-level programming language.
  • Repeating the previous step until you have no sentences left undefined. During this process each of sentences can be classified to belong to a section of the document to be produced in HTML or Latex format to form the final natural-language program.
  • Testing the meaning of each sentence by executing its code using testing objects.
  • Providing a library of procedure calls (in the underlying high-level language) which are needed in the code definitions of some low-level-sentence meanings.
  • Providing a title, author data and compiling the sentences into an HTML or LaTeX file.
  • Publishing the natural-language program as a webpage on the Internet or as a PDF file compiled from the LaTeX document.

Publication value of natural-language programs and documents

[edit]

A natural-language program is a precise formal description of some procedure that its author created. It is human readable and it can also be read by a suitable software agent. For example, a web page in an NLP format can be read by a software personal assistant agent to a person and she or he can ask the agent to execute some sentences, i.e. carry out some task or answer a question. There is a reader agent available for English interpretation of HTML based NLP documents that a person can run on her personal computer.

Contribution of natural-language programs to machine knowledge

[edit]

An ontology class is a natural-language program that is not a concept in the sense as humans use concepts. Concepts in an NLP are examples (samples) of generic human concepts. Each sentence in a natural-language program is either (1) stating a relationship in a world model or (2) carries out an action in the environment or (3) carries out a computational procedure or (4) invokes an answering mechanism in response to a question.

A set of NLP sentences, with associated ontology defined, can also be used as a pseudo code that does not provide the details in any underlying high level programming language. In such an application the sentences used become high level abstractions (conceptualisations) of computing procedures that are computer language and machine independent.

AI in natural language programming

[edit]

Researchers have started to experiment with natural language programming environments that use plain language prompts and then use AI (specifically large language models) to turn natural language into formal code. For example Spatial Pixel created a natural language programming environment to turn natural language into P5.js code through OpenAI's API. In 2021 OpenAI developed a natural language programming environment for their programming large language model called Codex.

Vibe coding

[edit]

Vibe coding is software development assisted by artificial intelligence (AI) where the software developer describes a project or task in a prompt to a large language model (LLM) which generates source code automatically. Vibe coding may involve accepting AI-generated code without thorough review of the output, instead relying on results and follow-up prompts to guide changes.[6][7]

The term was coined in February 2025 by computer scientist Andrej Karpathy, a co-founder of OpenAI and former AI leader at Tesla. Merriam-Webster listed the term in March 2025 as a "slang & trending" expression.[8] It was named the Collins English Dictionary Word of the Year for 2025.[9][10]

Advocates of vibe coding say that it allows even amateur programmers to produce software without the extensive training and skills required for software engineering.[11][12] Critics point out a lack of accountability, maintainability, and an increased risk of introducing security vulnerabilities in the resulting software.[6][12]

See also

[edit]

Programming languages with English-like syntax

[edit]

Programming languages with other natural language-like vocabulary or syntax

[edit]

References

[edit]
  1. Miller, L. A. (1981). "Natural language programming: Styles, strategies, and contrasts". IBM Systems Journal. 20 (2): 184–215. doi:10.1147/sj.202.0184.
  2. Development of reliable and trustworthy robots. "transparent robots" }
  3. Desai, Aditya, et al. "Program synthesis using natural language." Proceedings of the 38th International Conference on Software Engineering. ACM, 2016.
  4. Wolfram Alpha  how it works (part 2) Computer Weekly, 4 June 2009
  5. Wolfram Alpha computes answers Tech Crunch, 8 March 2009
  6. 1 2 Edwards, Benj (5 March 2025). "Will the future of software development run on vibes?". Ars Technica. Archived from the original on 6 March 2025. Retrieved 3 June 2025. The technique, enabled by large language models (LLMs) from companies like OpenAI and Anthropic, has attracted attention for potentially lowering the barrier to entry for software creation. But questions remain about whether the approach can reliably produce code suitable for real-world applications, even as tools like Cursor Composer, GitHub Copilot, and Replit Agent make the process increasingly accessible to non-programmers.
  7. "What is 'vibe code'? Former Tesla AI director Andrej Karpathy defines a new era in AI-driven development". The Times of India. 2 March 2025. Archived from the original on 4 March 2025. Retrieved 3 June 2025. Karpathy's "vibe coding" is a recognition of how sophisticated AI systems have evolved. In describing on X (formerly Twitter), he added that LLMs, like the Cursor Composer with Sonnet, are advancing to a degree that nearly eliminates the use of traditional coding mechanisms. Describing his own experience, Karpathy explained how he converses with AI tools almost in a passive manner—merely talking to them and having the AI handle the rest. This method eliminates manually typing code as well as keeping track of all the minute information in the program.
  8. "vibe coding". Slang & Trending. Merriam-Webster. 8 March 2025. Retrieved 2 June 2025. Vibe coding (also written as vibecoding) (Vibecode/Vibecoder) is a recently-coined term for the practice of writing code, making web pages, or creating apps, by just telling an AI program what you want, and letting it create the product for you. In vibe coding the coder does not need to understand how or why the code works, and often will have to accept that a certain number of bugs and glitches will be present. The verb form of the word is vibe code.
  9. Garnsworthy, Jenny (6 November 2025). "Collins dictionary crowns AI buzz term Word of the Year". The Independent. Retrieved 6 November 2025.
  10. "'Vibe coding' named word of the year by Collins Dictionary". BBC News. 6 November 2025. Retrieved 6 November 2025.
  11. Lanz, Jose Antonio (23 March 2025). "Vibe Coding: How Devs and Laymen Alike Are Using AI to Create Apps and Games". Decrypt.co.
  12. 1 2 Chowdhury, Hasan; Mann, Jyoti (13 February 2025). "Silicon Valley's next act: bringing 'vibe coding' to the world". Business Insider. Archived from the original on 26 February 2025. Retrieved 3 March 2025.

Bibliography

[edit]
Books
Papers at conferences
  • Veres, S.M.; Molnar, L. (2010). "Documents for Intelligent Agents in English". Artificial Intelligence and Applications. doi:10.2316/p.2010.674-122. ISBN 978-0-88986-817-5.
  • Sliding mode control of autonomous spacecraft. (half written in sEnglish) by S M Veres an N K Lincoln, Proc. TAROS’2008, Towards Autonomous Robotic Systems, Edinburgh, 1–3 September 2008.
  • Veres, Sandor M. (2010). "Mission Capable Autonomous Control Systems in the Oceans, in the Air and in Space". Brain-Inspired Information Technology. Studies in Computational Intelligence. Vol. 266. pp. 1–10. doi:10.1007/978-3-642-04025-2_1. ISBN 978-3-642-04024-5.
  • Pulido-Prieto, Oscar; Juárez-Martínez, Ulises (2017). "A Survey of Naturalistic Programming Technologies". ACM Computing Surveys. 50 (5): 1–35. doi:10.1145/3109481. S2CID 2078759.
Program synthesis from natural language specifications
[edit]
Natural language programming
Morty Proxy This is a proxified and sanitized view of the page, visit original site.