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

Re: [ProgSoc] CSS and Divs



John Elliot wrote:
> 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.
>

True to some degree, because every language borrows from others.

Prolog and LISP have 'performance enhancing' features that make them non-pure in
terms of the most "ideal" logical and functional languages. These features are
often borrowed from imperative languages.


> 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.
>

It isn't really, but it is a "bulk" classification around a large set of
different styles of programming languages.

Imperative languages are also known as "procedural languages", because they are
procedural! There is some implied sequence that gives specific directions or
commands.

Declarative languages do not impose such a sequence. Functional does it through
recursion, logical does it through deduction, abduction, etc. Rule engines do
it through backward- and forward-chaining.

Imperative languages generally require explicit state, assignments and
(potentially) side-effects to actually get anything done. Pure declarative
languages only use state implicitly (or indirectly), because they are
implemented on von Neumann or Harvard architecture microprocessors. In this
environment, a declarative language must always have a 'virtual machine'
because it cannot be directly converted to executing on these microprocessors
without some direct sequencing of logic (either during compilation or runtime
interpretation).

Cheers,

Nigel



-
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.