You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- $\begingroup$ "What matters semantically is what is done, not how (and how fast) it is done" -- it bears mention that non-functional criteria exist in practice. There are many functionally equivalent target programs but we may prefer some over others for some reason (efficiency, size, better memory alignment, ...). That is to say, the view of a compiler as a function as you define is more limited than we want it to be (it also often skips over side effects, e.g. I/O). It serves the explanatory purpose you want to to, though. $\endgroup$Raphael– Raphael2015-08-23 13:19:41 +00:00Commented Aug 23, 2015 at 13:19
- $\begingroup$ @Raphael Regarding full employment theorem, I had that in mind (in my comment on C), but I did not know the name, and postponed finding a reference. Thanks for doing it. --- The semantics I talk about is that of the compiler, not that of the target program. The target program is preserved syntactically and operationally, not just semantically. Or did I misunderstand your remark. I edited to make things more precise in my text. $\endgroup$babou– babou2015-08-23 13:49:00 +00:00Commented Aug 23, 2015 at 13:49
- $\begingroup$ @Raphael Since you did not delete your comment, does it mean that I misunderstood it, or did not answer it properly? How is it that the view of the compiler (not of the compiled program) as a function is too limited, from a semantic point of view. Of course, as a function, it could take other arguments than just the compiled program, such as optimization directives) but this is a detail that would not change the discussion. $\endgroup$babou– babou2015-08-23 14:56:22 +00:00Commented Aug 23, 2015 at 14:56
- $\begingroup$ I think my comment stands as a pointer towards "there's more than this model". What you write is not wrong, but it's not everything. Theoretically, this seems obvious: "the" compiler function is not per se well-defined since there are infinitely many possible target programs, all semantically equivalent. Which to pick is a very important part of designing compilers. $\endgroup$Raphael– Raphael2015-08-23 14:59:24 +00:00Commented Aug 23, 2015 at 14:59
- $\begingroup$ @Raphael There is only this model. You are misreading my text: I am saying "a computable function", because others are possible. The compiler is implementing one specific compiling function "curly $\mathcal C$", which is a function from S syntax to T syntax, defining a precise set of syntactic pairs of programs (italic letters). These pairs are supposed to compute the same function "curly $\mathcal P$", but the second component cannot be replaced by another one with the same property. I am intentionally ignoring the semantics of programs to keep things comparable in the translation processes. $\endgroup$babou– babou2015-08-23 15:51:08 +00:00Commented Aug 23, 2015 at 15:51
| Show 2 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
- MathJax equations
$\sin^2 \theta$
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. complexity-theory), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you