Tom Ritchford
1 min readJul 27, 2019

--

I’m really having trouble understanding why you think C has any similarity with a Turing machine at all.

The memory model of C is a dual one — there’s the program stack where local variables live, and then there’s the heap, where memory is dynamically allocated. Turing machines use a very different model — a tape that’s unbounded on one end.

C is procedural. C has arithmetic built right into the language. C does a great deal of things, like returning from subroutines, by (conceptually) copying a variable. (I am aware that behind the scenes, the compiler is probably doing the computations into a register so there’s no actual copy, but as a programmer, the value within the subroutine and the returned value are different variables.)

--

--

No responses yet