[TYPES] Declarative vs imperative

Chung-chieh Shan ccshan at indiana.edu
Fri Apr 19 13:51:53 EDT 2013


I once defined "declarative programming" as "the division of _what_
to do and _how_ to do it into two modules that can be built and
reused separately."  A declarative programming language is one way to
carry out such a division: the programmer says what and the language
implementation says how.  Of course, one person's "what" is another's
"how".  For example, maybe advertising revenue is "what" and machine
learning is "how", but it's also possible that machine learning is
"what" and floating point is "how".  So "declarative" is meaningful
insofar as we are clear about what counts as the "real world" in

On 2013-04-19T02:32:08-0400, Vijay Saraswat wrote:
> Hence understandable / accessible to people who
> are interested only in the real world phenomena that is being
> modeled (e.g. engineers, scientists, business users) and not
> necessarily how the reasoning is realized within modern
> computational hardware.

So, saying

On 2013-04-19T08:30:10+0100, Uday S Reddy wrote:
> Indeed, "declarative" means a lot.  But, "declarative programming language"
> doesn't.  All programming languages have a "declarative interpretation" and
> a "procedural interpretation" (to use terms invented in the logic
> programming community).  If somebody claims that some language is not
> "declarative", it just means that they never thought about its declarative
> interpretation, not that it doesn't exist.  Ignorance is peddled as a fact
> of reality.

is like saying that "tall" means a lot but every person is a "tall
person" because every person is taller than something.  In fact, each
meaningful use of the phrase "tall person" implicitly refers to a
standard of height, and probably not every person is taller than that
standard.  Similarly, each meaningful use of the phrase "declarative
programming language" implicitly refers to a notion of "what" versus
"how" -- a notion of "real world" versus "hardware" -- and probably not
every programming language represents that "what"/"real world" in an
"understandable / accessible" way.  Thus, someone can meaningfully claim
that some language is not "declarative" even if they know perfectly
well about another, less relevant, standard according to which the same
language is declarative.

On 2013-04-19T08:41:23+0100, Uday S Reddy wrote:
> Incidentally, Landin rejected the term "declarative" in 1966:
>   http://dl.acm.org/citation.cfm?id=365257
> and proposed "denotative" as a better description.  At the time of his
> writing, imperative programming languages were not "denotative", i.e., no
> denotational semantics was known for them.  Strachey fixed that problem soon
> afterwards.

I take `imperative programming languages were not "denotative"'
above to mean `imperative programming languages were not known to be
"denotative"'.  Even if a language has a denotational semantics, those
denotations might not be what we want to use the language for in the
"real world".  So Strachey didn't fix Landin's problem except if you
work on domain-specific languages in the specific domain of partial
orders.


More information about the Types-list mailing list