Re: Spoken programming language
From: | Christopher Wright <dhasenan@...> |
Date: | Saturday, January 3, 2009, 22:58 |
Paul Kershaw wrote:
>> I still think the following kind of distinction needs to be made:
>> Assert(apple.color == red); // "I assert/claim/state that the apple is red."
>> Query(apple.color == red); // "Is the apple red?"
>> Imperative(apple.color = red); // "Make the apple red!"
>> --gary
>
> I think a major obstacle to using computer language syntax for natural
> languages is the function of each sort of communication. Computer language is
> used almost exclusively to give commands to a subordinate system (i.e., the
> computer). If we're asking if an apple is red, it's because we want to know
> so that we can give an order concerning the apple (e.g., if (apple.color =
> red) pick(apple) -> "Is the apple red? If so, pick it!"), not because we're
> just curious or making idle conversation. So regardless, if we wanted to make
> computer language robust enough to tell stories, I agree, we'd need to build
> quite a bit of new structures.
There are declarative programming languages (Prolog, METAFONT) in which
the programmer describes the state of the world and can then query for
more interesting aspects of the world. These would be a much better
basis for a human language.