Programming language Paradigm

Source: Internet
Author: User

Many existing programming languages can be categorized based on their computational models, grouped into certain linguistic families, or in some programming paradigm. According to different rules, there can be many methods of classification, and different scholars have different opinions about the specific attribution of certain languages. Here we give a linguistic pedigree:

Explanatory formula (declarative)

function Type Lisp,ml,haskell

Data Flow Ld,val

Logic-Prolog

Template-based XSLT

Imperative (imperative)

von Neumann C,ada,fortran

Script-style perl,python,php

Object-oriented Smalltalk,c++,java

It is important to note that all programming paradigms are not listed here, as some programming paradigms are not categorized by the above methods, such as: meta-programming, generic programming. There is also a point is not a language only from a programming paradigm, in fact, some language itself is to support multi-paradigm design, such as: Lisp at the same time support functional programming, object-oriented, meta-programming.

Here are the different programming paradigms listed above:

  The functional (functional) language uses a recursive definition of function-based computational model. Their inspiration comes from the lambda calculus. Essentially, a program is considered to be a function from input to output, based on some simpler functions, defined by a process of gradual refinement. The primary way to calculate a functional language language is to apply a function to a given parameter. In the programming of a functional language, there can be no variables that are necessary for imperative language, either without an assignment statement or without a loop. Pure functional languages have no side-effects. In some programs, functional language represents the implementation of a mathematical model (lambda calculus) of a computer. Lisp is the first functional language, but not a purely functional one. Typical functional languages are F #, ML, and Haskell.

  The Data Flow (Dataflow) language calculates the flow of information as it flows between some basic functional nodes. These languages provide a model with intrinsic parallelism: nodes are triggered by the arrival of the input word and can be manipulated concurrently.

  logical (logic) or constraint-based (constrained-based) languages are inspired by propositional logic, who consider computing as a target-guided search process, trying to find values that satisfy certain relationships based on a set of logical rules. Prolog is the most well-known logical language.

  von Neumann language is our most familiar and most successful. All languages that change the value of the variable as the most basic method can be called the von Neumann language, including the familiar C,fortran waiting. This type of language is built on von Neumann architecture. Due to the von Neumann architecture, the core of such a language is the variable that simulates the storage unit, the assignment statement based on the transfer operation, and the iterative form of the loop operation. Therefore, from some program, this kind of language is based on another mathematical model of computer (Turing machine), which realizes the abstraction of computer hardware structure. The basis of a functional language is an expression with a value, whereas the von Neumann language is based on statements (especially assignments) that affect subsequent computations by modifying the values in the memory to produce side effects (side effect).

  The scripting language (Scripting) is a subclass of the von Neumann language, characterized by its emphasis on the use of separate programs developed in other languages as parts "to stick together". Python is the famous glue language, and some scripting languages have specific uses (for example, Bash is the shell language of the *nix system). But like Perl Python Ruby wants to be a common language.

  The object-oriented (object-oriented) language can be traced back to Simula 67, but what really makes the face of the object popular is Smalltalk, and even object-oriented is invented by the author of Smalltalk. Most object-oriented languages have deep roots in von Neumann language, but they use a more structured and distributed model in both storage and computing. The object-oriented language will compute the interaction of the individual objects based on the supremacy. Each object has its own internal state, as well as an executable subroutine that manages its own state.

The last point to emphasize is that the division between language classes is not absolute, and there are more than one way to divide it. Another common classification method is given here:

Command-type programming

Function-Type programming

Object-Oriented Programming

Logic-Type Programming

BTW: the imperative programming language here is equivalent to the von Neumann language, and is basically the same as what is often said for process-oriented programming.

References: Programming languages-the road to practice Michael Scott

Design principles 8th Edition Robert W. Sebesta

Programming language Paradigm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.