[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] CSS and Divs



Ryan Heise wrote:
To be even more brief:

*mutters*. :)

The declarative and imperative models that we've just looked at, are
computationally equivalent, but that does not that they are also
equivalent in their approach.

Earlier I commented about the use of the term 'declarative' and 'imperative' as being somewhat 'useful' in the sense that they point to the 'style' of a programming language. So, I have already conceded the 'fuzzy' practicality of such terms. ...but I object to it being held as *precisely* true that a so called 'declarative language' is actually 'declarative' when it can implement a turing machine.


For example we use the terms 'object-oriented', and 'procedural', and 'functional', etc. to describe various languages, even though any given language really has all of those capabilities (i.e. they are just ways of describing a program which can be translated into a turing machine). Something we call 'object-oriented' is just 'more' 'object-oriented' than it is 'functional', for example. Something that is 'functional' is just 'more' 'functional' than it is 'procedural', etc.

What we really mean is that in thinking and talking about a given programming language in English that it has been 'tuned', or 'optimised' for a particular 'style'. That is, it is syntactically more convenient to approach the description of an 'object' in an 'object-oriented' programming language than it is in a 'procedural' language, for example. We usually point to abstractions as being 'first class' in the language.

So, 'commands' are not 'first class' in (many) functional languages, such as Lambda calculus. However, as we can use those languages to encode what are effectively commands (this being true when we can implement turing machines), to say the language is 'declarative' isn't really a precise description, in my view.

That is, it doesn't *require* a 'declarative' style. It can be exploited to encode 'imperative' statements.

The distinction between the two is in their approach to computation
(declarative vs imperative), not in the power of their computation. I
think that is the distinction you were looking for.

Not really. :)

...but, that will do.

I will abandon my belief that 'declarative' is a precise term, and abandon my belief that when applied as a description of a language that it precludes that language from being concurrently 'imperative'.

So, 'declarative' becomes just another one of those content-free words which doesn't really mean anything. At least, not precisely. (It has strong context affinity.)

p.s. I'm pretty sure you can't implement a turing machine with declarative statements in English. That said, I'm fairly sure I could program humans (with some degree of confidence) using declarations. For example, if I were to say "This food is tasty, and it costs nothing." then it is quite likely the outcome would be as if I had have said "Eat this." The somewhat obtuse point hiding here being that a language's semantics are found in its execution environment, and English doesn't really have such a thing. At least not a reliable or fully specified one.











-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@xxxxxxxxxxxxxxxxxxx
If you are having trouble, ask owner-progsoc@xxxxxxxxxxxxxxxxxx for help.