3 ms·
> Memory in C can be changed even if it is not listed in the inputs or outputs of the function. If we are going to nitpick syntax, nothing about `mov eax ebx`
by dahfizz 5y ago
> Memory in C can be changed even if it is not listed in the inputs or outputs of the function.
If we are going to nitpick syntax, nothing about `mov eax ebx` lists main memory as output. In fact, mov doesn't even have an 'output'.
If you want to model mov as a function with the implicit output of "all of main memory", then you can do the same with any arbitrary C function. If you can't make that leap for C, then you can't make that leap for assembly.
- nightski 5y agoIt's not syntax, it is semantics. There is a lot to programming language theory/design and this is all formalized. C does not have the semantics you are describing in the formal specifications (C99, etc..). Could they have developed a version of C with these semantics? Possibly. Rust was a step in that direction with it's borrow checker.
- dahfizz 5y agoYes, and my whole point is that assembly does not have those semantics either. The computer is an imperative machine.
- TuringTest 5y agoThe computer is not an imperative machine. It's a physical machine that you describe with an imperative representation in your mind. Can you tell the difference, or are you unaware of the map-territory distinction going on? Functional programmers are simply choosing to use a different style of map, but we both represent the same reality.
- dehrmann 5y agoAccording to Wikipedia, "the hardware implementation of almost all computers is imperative." https://en.wikipedia.org/wiki/Imperative_programming https://en.wikipedia.org/wiki/Imperative_programming
- TuringTest 5y ago[Citation needed]