3 ms·
I don't know if that counts... I can read the 1s and 0s of a compiled binary in any language. Does that mean nothing a C compiler does is an optimization? I wo
by ragnese 6y ago
I don't know if that counts... I can read the 1s and 0s of a compiled binary in any language. Does that mean nothing a C compiler does is an optimization?
I wouldn't consider the memory layout of something like a stack to be part of the semantics of the language, unless that language actually includes features to directly refer to the stack (get its contents or size, etc).
- chrisseaton 6y ago> I can read the 1s and 0s of a compiled binary in any language But the 1s and 0s are not specified by the language (in almost all cases.) They're out of scope.
- ragnese 6y agoBut where is the line? Is the stack size specific by any languages? Many language's compilers will eliminate variable assignments as an optimization. Since I can view a stack trace in some of those languages, then would that make that not an optimization? Like, if I just inserted `let x = 3;` in the middle of my function, but never used `x`, it would disappear from the compiled code. If I look at the stack trace, I wont see my `x` variable. Is that an optimization or a semantic language feature? Does it matter?
- chrisseaton 6y ago> But where is the line? The line is: what has been formally specified by the language spec as being part of the language.