3 ms·
> As long as it accepts a Universe or State parameter, a system time function is referentially transparent. Which begs the question - where do you get that Uni
by catnaroek 10y ago
> As long as it accepts a Universe or State parameter, a system time function is referentially transparent.
Which begs the question - where do you get that Universe parameter from? Note that getting a single Universe parameter at the beginning of the program is of no use, because then you couldn't query the system date right now. You could only query the system date at the moment the program started.
You can't completely get rid of non-referentially transparent procedures in a general-purpose programming language. What you can do, at most, is banish them to a special sublanguage, like Haskell does.
> the Church-Turing thesis
The Church-Turing thesis is a statement about computable functions, but a procedure that returns the system date clearly doesn't compute a mathematical function.
- solidsnack9000 10y ago> ...getting a single Universe parameter at the beginning of the program is of no use, because then you couldn't query the system date right now. This is like saying, "...getting a single input at the beginning of the program is of no use..." but see below. > The Church-Turing thesis is a statement about computable functions... It is a statement about what is "computable", which is the alpha and the omega of what computers can do. If there is a Turing model for a particular "computation" there is a Lambda Calculus model for it. A program that returns the system date operates on the machine state. You can treat this as "read from the tape" in the Turing sense or as input in the Lambda Calculus sense. The "output" can be seen as one of: * A tape where the system states has been updated (since we took some steps, we updated the CPU counter, handled some interrupts, &c) and the system time has been written to a special place on the tape so the next computation can find it. * A tuple of a new system state and the time value (picked out, again, for our convenience). If we imagine the world "as a computer" then it is natural to compute a later state of the world as a function of the previous state. This approach actually works well in practice and it is not coincidental that this approach works with computers, since it is deeply tied into how they work. Per Heraclitus, we never set foot in the same river twice. Treating the State or Universe as non-comparable captures this idea.
- catnaroek 10y ago> It is a statement about what is "computable", which is the alpha and the omega of what computers can do. The Church-Turing thesis is about what functions are computable. > A program that returns the system date operates on the machine state. You can treat this as "read from the tape" in the Turing sense or as input in the Lambda Calculus sense. Are you saying that the input tape may contain the later time at which a program will query the system's date? That seems like a physical impossibility to me. > If we imagine the world "as a computer" then it is natural to compute a later state of the world as a function of the previous state. The fundamental deficiency of this model is that it assumes you can put the entire world inside your program, and then get an entire new world as result. It utterly fails to take concurrency into consideration.
- solidsnack9000 10y ago> The Church-Turing thesis is about what functions are computable. Are you saying, that procedural programming can do something besides compute computable functions? > Are you saying that the input tape may contain the later time at which a program will query the system's date? That seems like a physical impossibility to me. When the computer retrieves the time from the clock, it does exactly that -- reads it from a location in memory. > > If we imagine the world "as a computer" then it is natural to compute a later state of the world as a function of the previous state. > The fundamental deficiency of this model is that it assumes you can put the entire world inside your program, and then get an entire new world as result. It utterly fails to take concurrency into consideration. How does it fail to take concurrency into account? We can treat the world as being made up of many objects and evolve their state simultaneously if we like.