Natural language programming and literate programming

I do not see the difference between natural language programming and literate programming. If anyone explains, I will be grateful.

+4
source share
2 answers

Natural language programming is a system for expressing instructions to a computer in a form that approximates the language that people write or speak. The syntax structure of NLP usually resembles the sentence structure in human language, in a form that may sound oblique to a native speaker, but which, as a rule, reads almost like a real language. Many NLP implementations focus on querying data warehouses rather than writing programs, but there are also real programming implementations.

Good programming is a system for writing programs and writing programs at the same time. Unlike NLP, parts of the code of a literate program are written in traditional programming languages. Classical examples for which a name was invented are Donald Knuth's entries in the TeX dialing system. Printed books published as a series of "Computers and a set of fonts" are the result of processing his competent TeX program with a tool that extracts and formats only descriptive parts. Similarly, the compiled source code is the result of processing the same literate program with a tool that extracts and reorganizes parts of the code.

+3
source

A competent program is an explanation of the program logic in a natural language, such as English, interspersed with macro fragments and traditional source code. Macros in a literate source file are simply human language words or explanatory phrases that describe human abstractions created to solve a programming problem and hide code snippets or macros of a lower level. These macros are similar to pseudo-code algorithms commonly used in computer science teaching. These arbitrary explanatory phrases become exact new operators created on the fly by the programmer, forming a metalanguage on top of the main programming language.

An example is shown in the following link.

http://en.literateprograms.org/Insertion_sort_%28C%29

Natural Language Processing - Natural text processing. Natural text can be simple English, French or any language sentence. He is processing this proposal. This processing may include steps such as tokenization, partialization of speech tags, generation, legalization, analysis of moods, etc. This is mainly about getting meaning from any sentence using programming. This link will give an intro about NLP

http://www.youtube.com/watch?v=nfoudtpBV68

+3
source

Source: https://habr.com/ru/post/1501874/


All Articles