Declarative programming-Presentation programming language

Source: Internet
Author: User
Tags representational state transfer

The presentation of programming languages is illustrative, rather than concrete execution scenarios.

Usually his execution is carried out by the interpreter.

In computer science, declarative programming is a programming paradigm-a style of building the structure and Elem Ents of Computer Programs-that expresses the logic of a computation without describing its control flow. [1]

Many languages that apply this style attempt to minimize or eliminate side effects by describing what's the program Must accomplish in terms of the problem domain, rather than describe how to accomplish it as a sequence of the P Rogramming language Primitives[2] (the how being left up to the language ' s implementation). Contrast with imperative programming, which implements algorithms in explicit steps.

Declarative programming often considers programs as theories of a formal logic, and computations as deductions in that log IC space. Declarative programming may greatly simplify writing parallel programs. [3]

Common declarative languages include those of database query languages (e.g., SQL, XQuery), regular Expressions, logic programming, functional programming, and configuration Management Systems.

subparadigms[edit]

Declarative programming is an umbrella term that includes a number of better-known programming paradigms.

Constraint Programming[Edit]

Constraint programming states relations between variables in the form of constraints that specify the properties of the TA Rget solution. The set of constraints is solved by giving a value to each variable so, the solution is consistent with the maximum Nu Mber of Constraints. Constraint programming often complements other paradigms:functional, logical, or even imperative programming.

domain-specific Languages[edit]

Well-known examples of declarative domain-specific languages (DSLs) include the YACC parser Generator input language, QML, The Make build specification language, Puppet ' s configuration management language, regular expressions, and a subset of S QL (SELECT queries, for example). DSLs has the advantage of being useful while not necessarily needing to being turing-complete, which makes it easier for a l Anguage to be purely declarative.

Many markup languages such as HTML, MXML, XAML, XSLT or other User-interface markup languages is often declarative. HTML, for example, only describes what should appear on a webpage-it specifies neither control flow for rendering a page nor the page ' s possible interactions with a user.

As of some software systems combine traditional User-interface markup languages (such as HTML) with declarative Marku P that defines "what" and "how" the Back-end server systems should do-to-support the declared interface. Such systems, typically using a domain-specific XML namespace, may include abstractions of SQL database syntax or paramete Rised calls to Web services using representational state transfer (REST) and SOAP.

Hybrid Languages[edit] See Also:multi-paradigm programming language

Makefiles, for example, specify dependencies in a declarative fashion,[5] but include an imperative list of actions to Take as well. Similarly, YACC specifies a context free grammar declaratively, but includes code snippets from a host language, which is Usually imperative (such as C).

Logic Programming[Edit]

Logic programming languages such as Prolog State and query relations. The specifics of how these queries was answered is up to the implementation and its theorem prover, but typically Take the form of some sort of unification. Like functional programming, many logic programming languages permit side effects, and as a result is not strictly declar Ative.

Https://en.wikipedia.org/wiki/Declarative_programming

Declarative programming-Presentation programming language

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.