Declarative programming

From Academic Kids

Declarative programming is an approach to computer programming that involves the creation of a set of conditions that describe a solution space, but leaves the interpretation of the specific steps needed to arrive at that solution up to an unspecified interpreter. Declarative programming thus takes a different approach from the traditional imperative programming found in Fortran, C or Pascal which requires the programmer to provide a list of instructions to execute in a specified order.

In other words, declarative programming provides the what, but leaves the how up to interpretation. This is why declarative solutions are said to have two independent phases: declaration and interpretation.

Declarative languages describe relationships between variables in terms of functions, inference rules, or term-rewriting rules. The language executor (an interpreter or compiler) applies a fixed algorithm to these relations to produce a result.

Declarative programming includes both functional programming and logic programming. Declarative programming was also known as Value-oriented programming, but this term has lately fallen out of use.

Contents

Advantages

  1. The solution can address the problem at an abstract level without delving into irrelevant details. This makes the solution easier for humans to understand.
  2. Complex problem solving is isolated and handled by the interpreter
  3. The Reinventing the wheel anti-pattern is avoided (i.e. one interpreter written years ago can apply its logic to a wide variety of declarative specifications),
  4. Re-use/re-interpretation in different contexts is possible (e.g. different language bindings for IDL)

Applications

Declarative programming languages are extensively used in solving problems related to artificial intelligence, constraint-satisfaction problems, databases, configuration management and Inter-process communication.

In addition to the domains listed above, declarative programming is becoming a vital part of many Enterprise Programming solutions. For instance, instead of couching transactions and database access within procedural code, the application developer simply declares the relationships/dependencies between higher level objects (e.g. transactions and object interfaces) and the implementation is left to the framework. See Hibernate (software), Enterprise Java Beans or Spring framework for examples of how this works.

Many of the dialects being created based on the XML format can be described as declarative due largely to the increasing popularity of the declarative programming paradigm.

Example languages

Representative examples of declarative programming languages include Oz, Prolog, Haskell, Miranda, SQL, TK Solver, and WSDL.

Category:Declarative programming languages provides an exhaustive list.

See also

Navigation

Academic Kids Menu

  • Art and Cultures
    • Art (http://www.academickids.com/encyclopedia/index.php/Art)
    • Architecture (http://www.academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (http://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (http://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools