3 ms·
>...so you only need to follow the semantics of the language, not the actual implementation. Wouldn't you need to follow the syntax and not the semantics? Aren
by dmux 10y ago
>...so you only need to follow the semantics of the language, not the actual implementation.
Wouldn't you need to follow the syntax and not the semantics? Aren't the semantics what the syntax is abstracting? (I'm genuinely curious, not trying to flame.)
- z1mm32m4n 10y agoNot OP, but I'm pretty sure you care more about the semantics here. The syntax is really just one way to express an intention. What you care about are the intensions--the meanings. That's exactly what the semantics are. For example, the semantics of this statement in Java int foo = 1 / 0; are very different from the semantics of this statement in JavaScript: var foo = 1 / 0; even though the two are syntactically rather similar. (In the former, Java will throw an ArithmeticException, whereas in JavaScript it will return Infinity.) So you want to ensure that your translation is meaning preserving, that is, that the source code and the generated code are semantically the same.