World Library  
Flag as Inappropriate
Email this Article

Concept programming

Article Id: WHEBN0002875061
Reproduction Date:

Title: Concept programming  
Author: World Heritage Encyclopedia
Language: English
Subject: Semantic-oriented programming, XL (programming language), Programming paradigms, List of programming languages by type, Christophe de Dinechin
Collection: Programming Paradigms
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Concept programming

Concept programming is a programming paradigm focusing on how concepts, that live in the programmer's mind, 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 1
  • Rule of equivalence, equivalence breakdown 2
  • Methodology 3
  • Languages 4
  • Similar works 5
  • See also 6
  • External links 7

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 (also concept recast or concept recasting) 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.

Similar works

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

See also

External links

  • The XL Programming Language on SourceForge
  • A presentation of Concept Programming
  • An interview about Concept Programming on The Register
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.