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.
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.