Re: My Problem | What is right for ...
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: 27 Apr 2007 20:58:00 GMT
Kenneth Brody <kenbrody@xxxxxxxxxxx> writes:
WillerZ wrote:
[... C and C++ ...]
Oliver Wong wrote:
Both languages are Turing Complete, meaning essentially any program
you can write in one language, you could also write in the other.
Actually, no implementation of either language is Turing Complete.
A Turing Complete language is one which can simulate the operation of a
turing machine.
A Turing Machine has an infinitely long tape, and can therefore record
an infinite number of things.
In C or C++, everything can be addressed by a void *, and the size of a
void * must be defined (CHAR_BIT * sizeof(void *) bits). Therefore any
implementation of either language is limited to recording a finite
number of things.
Nothing says you can't use virtual memory. While it's true not there
is no such thing as "infinite storage", you can have "arbitrarily large
storage". As long as the hardware and O/S support it, you can use an
arbitrarily large storage device, along with some "bignum" library to
hold the data.
Addressible storage is still limited by the size of void*. Each byte
of each existing object must have a distinct address, and there can be
at most 2**(CHAR_BIT * sizeof void*) such addresses.
Does a Turing machine really need inifite storage, or does it simply
need to never hit either end of the "infinitely long" tape?
If I recall correctly, it really needs unbounded storage -- which can
(theoretically) be obtained in C by using a file.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
--
comp.lang.c.moderated - moderation address: clcm@xxxxxxxxxxxx -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
.
- References:
- My Problem | What is right for ...
- From: Payam . Babaiy
- Re: My Problem | What is right for ...
- From: Oliver Wong
- Re: My Problem | What is right for ...
- From: WillerZ
- Re: My Problem | What is right for ...
- From: Kenneth Brody
- My Problem | What is right for ...
- Prev by Date: Re: My Problem | What is right for ...
- Next by Date: Re: Noob Question
- Previous by thread: Re: My Problem | What is right for ...
- Next by thread: Re: My Problem | What is right for ...
- Index(es):
Relevant Pages
|
Loading