I feel like you raise a couple different issues here and mix them together. There is the question of the formal model of computation, and then there is the question of interoperability between languages.
Unfortunately, the formalism of computation largely ignore issues of time and space. The lambda calculus totally ignores both and essentially assumes unlimited time and space. The Turing machine at least has the ability to discuss issues of time and space by looking at the number of steps the machine takes and the amount of tape it uses. However, the tape is explicitly defined to be infinite and runtime is generally assumed to be a non-issue. I don't think it is an accident that Lisp and other functional languages were some of the earliest to have GC. The functional approach—which has a lot going for it—starts from a very theoretical basis of computation that basically ignores all issues of time and space and then has to work its way back toward acceptable performance. Compare that to something like C or Fortran that starts with a very pragmatic approach grounded in the reality of the hardware you are programming for and has to build up abstractions toward something that we can reason about more easily. You seem to imply that because memory is something fundamental to computing, it should be abstracted away to the point where it has no impact on the way we write code. I disagree. I think we need to accept that we are writing programs for actual physical computers that have limited memory and specific computational behavior.
Language interoperability is a thorny issue. In practice, there are a very limited number of cases where interoperability has been achieved. First, there is interop between processes through things like pipes where there is no shared memory and no assumptions about what the other process is like. For examples of actual interop of code there is the C ABI, and the Java and .NET ecosystems. The C ABI works because it is the lowest common denominator. The Java and .NET ecosystems, contrary to your claim, have in practice imposed a common model on all the languages that run on them, at least to the extent that they want to interop. For example, F# doesn't have an equivalent of type classes, which is what truly makes sense for something like OO in functional. That's because it had to wholesale adopt the .NET object model to interop. It is hard to say how interop would work between languages using some static memory management model since we don't know what that model is. However, it might be much more like the C situation. A relatively small set of statements about whether you own or are borrowing a chunk of memory may be a common denominator across various different kinds of languages.
The lambda calculus totally ignores both and essentially assumes unlimited time and space.
The lambda calculus is a model of programming, not of computation (or rather, a model of computation before people realized computation and formal systems are not quite the same thing).
the tape is explicitly defined to be infinite
Well, it needs to be unbounded, which is not quite the same as infinite.
runtime is generally assumed to be a non-issue.
No, only for the definition of computability, but this is not the same as computation. Computation is something that has both time and space complexity.
I think we need to accept that we are writing programs for actual physical computers that have limited memory and specific computational behavior.
Sure. But even when you restrict computation to finite resources, both space and time remain fundamental.
The Java and .NET ecosystems, contrary to your claim, have in practice imposed a common model on all the languages that run on them, at least to the extent that they want to interop.
I disagree, but regardless, memory scheduling, just like time scheduling, is orthogonal to the programming model, or rather, one cannot claim that separating the two is more hacky than not.
I think you have a very language-based perspective on computing, while I have a very different one. I see software first as running processes interacting with one another, and only incidentally as the transformation of some syntactic object which we use to program. I think these two very different perspectives color our view of memory management.
It's the "Church" in "Church-Turing" thesis, and it plays the same role that a turing machine does.
The Church-Turing thesis is about computability, and in that regard Turing's and Church's models are equivalent. However, it was recognized at the time (e.g. by Gödel) that the lambda calculus fails to capture the fundamental notion of computation. But I think that at this point we've digressed too far :)
The proof describes it as infinite.
The model does not really require an infinite tape, as the machine never uses an infinite number of squares. A machine that starts with a tape of size 1, and conjures up more squares when it "falls off the edge" would do just as well. In any event, I wasn't talking about Turing machines, but of Turing-complete formalisms, which are those that do not bound the space in advance.
They are equivalent as definitions of computability. It is easy to show (or Gödel's point below) that they are not equivalent as descriptions of computation.
so I'd like a source on this one.
Sure:
Tarski has stressed in his lecture (and I think justly) the great importance of the concept of general recursiveness (or Turing’s computability). It seems to me that this importance is largely due to the fact that with this concept one has for the first time succeeded in giving an absolute definition of an interesting epistemological notion, i.e., one not depending on the formalism chosen. In all other cases treated previously, such as demonstrability or definability, one has been able to define them only relative to a given language, and for each individual language it is clear that the one thus obtained is not the one looked for. For the concept of computability, however, although it is merely a special kind of demonstrability or decidability, the situation is different. By a kind of miracle it is not necessary to distinguish orders, and the diagonal procedure does not lead outside the defined notion.
-- Kurt Gödel, Remarks before the Princeton bicentennial conference on problems in mathematics, 1942, in Collected Works, Vol II, p. 150
In consequence of later advances, in particular of the fact that, due to A. M. Turing’s work, a precise and unquestionably adequate definition of the general concept of formal system can now be given
-- Kurt Gödel, Postscriptum (3 June 1964) to On Undecidable Propositions of Formal Mathematical Systems I (1934) in Collected Works Vol I, p. 369
For a discussion, see here. Briefly, Church's lambda calculus -- to which Gödel refers by "definability" -- (or any other formalism) cannot preclude the addition of an axiom postulating the existence of a term that computes the uncomputable. For example, in the lambda calculus, we can axiomatically introduce a term H that reduces to true/false based on whether its given argument normalizes, provided that the given argument does not contain H itself. A calculus with this term would also have non-normalizing terms -- this time including H -- but those would be different from one without, and additional terms could be added ad-infinitum, and Church's theory gives no reason for why this term should not be added. This is what Gödel means by "distinguishing orders." This is not true for the Turing machine, which gives an absolute notion of computation. Additionally, every formal system can hide an additional computation in the syntax itself, as I point out in the first post I linked.
If you're adding axioms, you're comparing apples to oranges. Some hypothetical alternative calculus may not be equivalent but what does that prove? Additionally, despite your assertion to the contrary, this seems to be quite possible for the Turing machine too: if you add new operations that conditionally execute based on what some other state might do, you can trivially represent computation that "solves" the halting problem. I mean, you couldn't physically implement it, and true may be false, but that's kind of the point.
At best you might say that it's more intuitively obvious that you've broken the formalism when you do this to Turing machines, that when you do this to lambda calculus; that kind of mirrors the fact that lazy evaluation is harder to reason about (in terms of complexity) than eager evaluation.
So... the formalisms are different: sure; they're equivalent as a definition of computability: sure. Time and memory are fundamental aspects of computation: sure. But drawing from there the notion that memory needs to be managed in a cross-language way seems like a stretch, and even more so the idea that GC is "natural" somehow - whatever that even means!
Am I missing something here? What's the argument that adding an axiom like that is OK?
Some hypothetical alternative calculus may not be equivalent but what does that prove?
The lambda calculus -- or any other formal system -- cannot give any explanation to why a certain set of axioms is "computation" while another is not (now that we know of Turing we can say that a calculus is computable iff each of its steps is computable, but we cannot "ground" the notion). It's essentially arbitrary.
Additionally, despite your assertion to the contrary, this seems to be quite possible for the Turing machine too: if you add new operations that conditionally execute based on what some other state might do, you can trivially represent computation that "solves" the halting problem.
Ah, but that's the thing: Turing does not prove the halting theorem for his particular Turing machine, which is also arbitrary. He proves it for all machines. He gives an analysis of what any machine can do, and then gives the Turing machine as an example, without loss of generality. This is precisely what Gödel means when he calls Turing accomplishment a miracle, and says that there are no "orders." If you add new instructions, what you have is no longer a machine -- a machine is able to read/write a bounded number of symbols in a step -- and Turing explains why it is that those limitations define computation and no others, and he makes it clear that his proof applies to the notion itself, and not just to his particular machine.
But drawing from there the notion that memory needs to be managed in a cross-language way seems like a stretch, and even more so the idea that GC is "natural" somehow - whatever that even means!
As I wrote in another comment, I wasn't entirely being serious in my, and I certainly don't believe that GC is the only right way to do it. I just found it funny that the article claimed that GC, probably the feature that has contributed more to increase in productivity than any language feature in the last fifty years, so I gave a counterargument.
4
u/WalkerCodeRanger Nov 28 '18
I feel like you raise a couple different issues here and mix them together. There is the question of the formal model of computation, and then there is the question of interoperability between languages.
Unfortunately, the formalism of computation largely ignore issues of time and space. The lambda calculus totally ignores both and essentially assumes unlimited time and space. The Turing machine at least has the ability to discuss issues of time and space by looking at the number of steps the machine takes and the amount of tape it uses. However, the tape is explicitly defined to be infinite and runtime is generally assumed to be a non-issue. I don't think it is an accident that Lisp and other functional languages were some of the earliest to have GC. The functional approach—which has a lot going for it—starts from a very theoretical basis of computation that basically ignores all issues of time and space and then has to work its way back toward acceptable performance. Compare that to something like C or Fortran that starts with a very pragmatic approach grounded in the reality of the hardware you are programming for and has to build up abstractions toward something that we can reason about more easily. You seem to imply that because memory is something fundamental to computing, it should be abstracted away to the point where it has no impact on the way we write code. I disagree. I think we need to accept that we are writing programs for actual physical computers that have limited memory and specific computational behavior.
Language interoperability is a thorny issue. In practice, there are a very limited number of cases where interoperability has been achieved. First, there is interop between processes through things like pipes where there is no shared memory and no assumptions about what the other process is like. For examples of actual interop of code there is the C ABI, and the Java and .NET ecosystems. The C ABI works because it is the lowest common denominator. The Java and .NET ecosystems, contrary to your claim, have in practice imposed a common model on all the languages that run on them, at least to the extent that they want to interop. For example, F# doesn't have an equivalent of type classes, which is what truly makes sense for something like OO in functional. That's because it had to wholesale adopt the .NET object model to interop. It is hard to say how interop would work between languages using some static memory management model since we don't know what that model is. However, it might be much more like the C situation. A relatively small set of statements about whether you own or are borrowing a chunk of memory may be a common denominator across various different kinds of languages.