Jump to content

Talk:Declarative programming language

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 83.31.188.228 (talk) at 22:24, 1 August 2006 (Makefiles). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputer science Redirect‑class
WikiProject iconThis redirect is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
RedirectThis redirect does not require a rating on Wikipedia's content assessment scale.
Things you can help WikiProject Computer science with:

His O

IMO SQL isn't a programming language, rather a query language.

Makefiles

Is a Makefile declarative programming?

No. Unless you use non-standard features, it's hardly "programming", to begin with. (And if you do use those features, it's imperative programming.) --Piet Delport 11:22, 2 January 2006 (UTC)[reply]
Yes. It allows one to make a computer perform some actions to achieve desired effects. It is a bit like SQL, classified here as programming language but from a different side. In SQL there are implicit loops, wound around fetched data, and in make there are implicit conditionals threaded between targets. In fact I am not really sure if a real, Turing complete, programming lnaguage with both loops and conditional statemets can be a declarative one. --steelman 22:24, 1 August 2006 (UTC)[reply]

Wrong sentence

It is wrong: "Sometimes, functional programming languages are called declarative programming languages". Eduard Proydakov.

More precise clarification of "Declarative" required

In support of the previous discussion topic, there are a number of other definitions of what precisely constitutes "Declarative" that need to be considered.

See for instance Functional Programming is not [declarative]:

A pertinent quote from the preface to the first edition of SICP, which clearly defines the differing philosophies:

Underlying our approach to this subject is our conviction that "computer science" is not a science and that its significance has little to do with computers. The computer revolution is a revolution in the way we think and in the way we express what we think. The essence of this change is the emergence of what might best be called procedural epistemology--the study of the structure of knowledge from an imperative point of view, as opposed to the more declarative point of view taken by classical mathematical subjects. Mathematics provides a framework for dealing precisely with notions of "what is". Computation provides a framework for dealing precisely with notions of "how to".

And in section 1.1.7 (2nd ed.):

The contrast between function and procedure is a reflection of the general distinction between describing properties of things and describing how to do things, or, as it is some times referred to, the distinction between declarative knowledge and imperative knowledge. In mathematics we are usually concerned with declarative (what is) descriptions, whereas in computer science we are usually concerned with imperative (how to) descriptions.

I would hesitate to make the artificial division between Computer Science and Mathematics, though. Mathematics definitely has both the declarative - functions, and the imperative - formulas that define how to calculate functions (there may be recursive implications to formulas, which can themselves be defined in terms of functions, but this seems to be a dangerous route to go down and may lead into Gödel's incompleteness theorem territory).

Perhaps, it could be said that the current perception of the difference between Computer Science and Mathematics varies in the emphasis placed upon how important declarative versus imperative modes of conceptualizing are. posted by TheUser on June 1 2005 -- please sign your posts by typing ~~~~

That discussion on LtU is interesting, but I take the discussion there with a grain of salt. (Actually, I take any discussion not by Ehud or Anton or a few others with a grain of salt, but there's no need to play favorites here.) The best point made in the discussion is that strictly declarative programs don't express algorithms. This is and is not true. What about:
fib = 1 : 1 : zipWith (+) fib (tail fib)
A little shaky. I mean, there's only one sensible way to compute that, and Haskell does it. But what then:
fac n = product [1..n]
That's about as declarative as I can make the definition of the factorial of n: the product of the digits from 1 to n. There are a number of ways product could work, I don't care how it does it. I also don't care about how [1..n] is constructed. In fact, Haskell won't construct a list (from the bottom or the top) and then go up (or down) it, but instead go from 1 up to n, multiplying on the way.
As for my rewrite, I cleared up the text a lot, adding examples of purely declarative languages and the question as to whether or not they're programming languages. I don't think this page is a good place to play out that debate, and it's enough to leave it as a question. I also cleaned up the list of decl. PLs. Might be nice to link to the Rogue-like game in Prolog.
What the page does need now, though, are more examples of declarative programming in action. It's the sort of thing you only know when you see it, and the more examples the better. --Mgreenbe 11:41, 6 December 2005 (UTC)[reply]