Is this a true statement?

Rainer Deyke root at rainerdeyke.com
Mon Jun 25 15:37:41 EDT 2001


"Tim Daneliuk" <tundra at tundraware.com> wrote in message
news:3B3788A2.3BD1D672 at tundraware.com...
> Rainer Deyke wrote:
> > To a program, "doing something" means "interacting with the outer
world".
> > It is a given that, if a program can receive the proper input from the
> > world, it can calculate (but not necessarily perform) the proper output.
> > Python includes many ways of interacting with the outer world in its
> > standard library, but C++ usually includes more.  Python can sometimes
get
> > around this by outputting machine code, but only if the problem is
defined
> > in a way that allows this.

> I still do not understand/agree with this line of reasoning entirely.

Your reasoning is flawed.

> As I mentioned in a previous post, one has to define what we mean by
> "do" or "program".  It is a fundamental truth of Computer Science that
> all Turing-Complete languages have *exactly* the same computational
> abilities - i.e., They all handle the exact same set of algorithms -
> in particular, those algorithms which are Turing Computable (which
> excludes things like the Halting Problem).  This *includes* all
> "interactions with the outside world" because such interaction
> is, by definition, algorithmic.

Interaction with the outside world is, by definition, *not* algorithmic.

Consider this diagram of a typical computer program:

Input -> Computation -> Output

Only the "computation" part is algorithmic, and those who use the term
"Turing complete" generally only concern themselves with the computation
part.  As I understand it, a Turing machine has the ability to input and
output single characters/numbers through a single input stream and a single
output stream.  A Turing machine does *not* have the ability to display
graphics of any kind.  There is the possibility that another machine turns
the output of the Turing machine into graphics, but then it is that machine,
not the Turing machine, which is generating the graphics.

> (Fine Point:  There is a debatable point here about whether adaptive
> algorithms like those found in Genetic Programming are really formally
> "algorithms" at all because they do not behave consistently when faced
with
> he same input conditions, but that's way outside the scope of this
discussion.)

All computer programs are deterministic.  Any computer program that
generates output O from input I will always generate output O from input I.

> Now, back to the debate at hand.  We've all agreed that some things
> are easier to do in C++ (yuck) than Python.  Let's take the example
> of writing device drivers.  Using today's language and syntax to
> handle interrupts in Python, you realistically have only a few
> choices:
>
> 1) Write a library in another language that implements
>    interrupt handling and then give it a Python interface.
>
> 2) Have Python write out a set of machine code bits which
>    are understood by the underlying implementation and
>    hardware to be the correct handling of an interrupt.

Only if the system has a writeable disk with sufficient empty space.  This
is not a given.

> 3) Add a native interrupt object to the language.
>
> 1) clearly takes us out of "pure Python" and is thus of no further
> interest (unless you actually want to *solve* this problem in the
> real world, in which case this is probably the best solution ;)))
>
> 2) Works just fine, but is kind of clumsy and unnatural to use.
> Note, however, that it is 2) that gives us the ability to do *anything*
> in Python which we can "do" in any other Turing-Complete language.
>
> 3) is where the rocks start to get thrown.  If I do 3), have I "extended"
> the language to do something it could not previously?  NO!  I have
> implemented what I could already do with 2) in a more programmer-friendly
> manner, but I have not changed the net computational power of the
language.

"Net computational power" is irrelevant in this context.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list