3 ms·
> are something defined by the source language, not by the calling convention of the target architecture/platform In that case perhaps the response should have
by jhgb 5y ago
> are something defined by the source language, not by the calling convention of the target architecture/platform
In that case perhaps the response should have been "pass-by-reference doesn't exist on machine level", not "pass-by-reference is something different", as the latter would seem to be a category error.
- Koshkin 5y ago> the response should have been "pass-by-reference doesn't exist on machine level" Which would barely make any sense.
- jhgb 5y agoHow come? It would illustrate the notion that to a machine, everything is a value, and that (abstract) references get translated into manipulations of values (and not even always in the same way).
- MaxBarraclough 5y agoAssuming the machine code has no concept of a function call, isn't it true to say that pass-by-reference doesn't exist at the machine level? Function calls are a high level concept that compile down to machine code. A typical CPU deals with abstractions like jumps and copies, and has no real concept of a function call. It seems fair to say that, at the level of a typical assembly language/machine language, there is no argument passing, and therefore no evaluation strategy. Same goes for a Turing machine.
- Koshkin 5y agoThis is similar to saying, for instance, that there are no pointers, at the machine level, just integers. (In fact, there are just bits and, maybe, bytes, for that matter.) But it is the usage semantics that matters. (Typically, CPU architectures are designed with it in mind.) An instruction that saves the the next instruction's address somewhere before performing the jump cannot be thought of as simply combining two arbitrary operations into one...