Concept programming

Concept programming

Concept programming is a programming paradigm focusing on how concepts, that live in the programmer's head, translate into representations that are found in the code space. This approach was introduced in 2001 by Christophe de Dinechin with the XL Programming Language.

Contents

Pseudo-metrics

Concept programming uses pseudo-metrics to evaluate the quality of code. They are called pseudo-metrics because they relate the concept space and the code space, with a clear understanding that the concept space cannot be formalized strictly enough for a real metric to be defined. Concept programming pseudo-metrics include:

  • Syntactic noise measures discrepancies between the concept and the syntax used to represent it. For instance, the semi-colon at the end of statements in C can be considered as syntactic noise, because it has no equivalent in the concept space.
  • Semantic noise measures discrepancies between the expected meaning or behavior of the concept and its actual meaning or behavior in the code. For instance, the fact that integer data types overflow (when mathematical integers do not) is a form of semantic noise.
  • Bandwidth measures how much of the concept space a given code construct can represent. For instance, the overloaded addition operator in C has higher bandwidth than the Add instruction in assembly language, because the C operator can represent addition on floating-point numbers and not just integer numbers.
  • Signal/noise ratio measures what fraction of the code space is used for representing actual concepts, as opposed to implementation information.

Rule of equivalence, equivalence breakdown

The rule of equivalence is verified when the code behavior matches the original concept. This equivalence may break down in many cases. Integer overflow breaks the equivalence between the mathematical integer concept and the computerized approximation of the concept.

Many ways to break the equivalence have been given specific names, because they are very common:

  • A domain error is a condition where code executes outside of the domain of equivalence, which is the domain where the concept and the implementation match. An integer overflow is an example of domain error.
  • A concept cast is a rewrite of a concept as a different concept because the original concept cannot be represented by the tools. In C, using pointers for output arguments because C doesn't support output arguments explicitly is an example of concept cast.
  • A priority inversion is a form of syntactic or semantic noise introduced by some language-enforced general rule. It is called a priority inversion because the language takes precedence over the concept. In Smalltalk, everything is an object, and that rule leads to the undesirable consequence that an expression like 2+3*5 doesn't obey the usual order of operations (Smalltalk interprets this as sending the message * to the number resulting from 2+3, which yields result 25 instead of 17).

Methodology

To write code, concept programming recommends the following steps:

  1. Identify and define the relevant concepts in the concept space.
  2. Identify traditional notations for the concepts, or invent usable notations.
  3. Identify a combination of programming constructs that allows the concepts to be represented comfortably in code - That includes finding a code notation that matches the notation identified in the previous step as closely as possible.
  4. Write code that preserves, as much as possible, the expected behavior and semantics of the relevant aspects of the original concept.

Many programming tools often lack in notational abilities, thus concept programming sometimes requires the use of preprocessors, domain-specific languages, or metaprogramming techniques.

Languages

XL is the only programming language known to date to be explicitly created for concept programming, but concept programming can be done in nearly any language, with varying degrees of success. Lisp and Forth (and their derivatives) are examples of pre-existing languages which lend themselves well to concept programming.[citation needed]

Similar works

There are projects that exploit similar ideas to create code with higher level of abstraction. Among them are:

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Concept learning — Concept learning, also known as category learning, concept attainment, and concept formation, is largely based on the works of the cognitive psychologist Jerome Bruner. Bruner, Goodnow, Austin (1967) defined concept attainment (or concept… …   Wikipedia

  • Concept-oriented design — (COD) is a theory of design and development based upon the language and diagrams of practitioners. It has been implemented in a tool Chasm to build 3D user interfaces (3DUIs). Its name is borrowed from the generic programming idea of a software… …   Wikipedia

  • Programming paradigm — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concu …   Wikipedia

  • Programming language theory — (commonly known as PLT) is a branch of computer science that deals with the design, implementation, analysis, characterization, and classification of programming languages and programming language features. It is a multi disciplinary field, both… …   Wikipedia

  • Programming in the large and programming in the small — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concurrent computin …   Wikipedia

  • Programming by demonstration — (PbD) is a technique for teaching acomputer or a robot new behaviors by demonstrating the task totransfer directly instead of programming it through machinecommands.The term Programming by example (PbE) or Programming bydemonstration (PbD)… …   Wikipedia

  • List of programming languages by category — Programming language lists Alphabetical Categorical Chronological Generational This is a list of programming languages grouped by category. Some languages are listed in multiple categories. Contents …   Wikipedia

  • Concept-oriented model — Example of a concept oriented model. The concept oriented model (COM) is a data model based on the following three principles: Duality principle postulates that any element consists of two parts, called identity and entity. Accordingly, data… …   Wikipedia

  • Concept (generic programming) — In generic programming, a concept is a description of supported operations on a type, including syntax and semantics. In this way, concepts are related to abstract base classes but concepts do not require a subtype relationship. Contents 1… …   Wikipedia

  • Concept map — For concept maps in generic programming, see Concept (generic programming). Example concept map, created using the IHMC CmapTools computer program. A concept map is a diagram showing the relationships among concepts. It is a graphical tool for… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”