Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is "compile"? #5641

Open
FrankHB opened this issue Jul 24, 2022 · 2 comments
Open

What is "compile"? #5641

FrankHB opened this issue Jul 24, 2022 · 2 comments

Comments

@FrankHB
Copy link
Contributor

FrankHB commented Jul 24, 2022

The core rules have no definitions or requirements about "compile". Instead, there are phrase of "during tranlsation", supported by rules in [lex]. However, there is one instance of "compile" in [intro.compliance.general] and many instances of phrases like "compile-time" in the normatie library clauses. So comes the problem: is it intentional to differentiate these mentioning? If so, what does "compile" exactly mean?

The problem raises, because traditionally "compile" is performed by a compiler, and now there do exist interpreters rather than compilers like Cling. And it seems clear enough that we don't want to rule out even pure interpreters (without any JIT compilation techniques, etc.) so "translation unit" is used instead of "compilation unit" (as languages like Java). Then there are inconsistencies.

Probably the instance in [intro.compliance.general] can be informative, all "at compile time" can be "during translation", and all other "compile" can be "translate"/"translation". Otherwise, we may need some addtional normative rules to clearify what "compile" is meaning in the existing clauses, and to show how necessary it is not just "translate".

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Jul 30, 2022

I believe that the difference between compilation and translation is out of the scope of the C++ standard. The Index seemly implies that "compilation and translation are the same thing", but this is not clarified.

It seems that we should consistently use "translate"/"translation" among the standard (especially including the titles of [intseq] and [ratio]) and avoid saying "compile"/"compilation"/"compiler" in normative text.


Or, since "polymorphic"/"polymorphism" in the standard do have some C++-specific meanings that are different from the general meanings, perhaps it's also OK to say "compilation and translation are the same thing" in the standard?

@FrankHB
Copy link
Contributor Author

FrankHB commented Aug 6, 2022

It seems that we should consistently use "translate"/"translation" among the standard (especially including the titles of [intseq] and [ratio]) and avoid saying "compile"/"compilation"/"compiler" in normative text.

I agree.

Or, since "polymorphic"/"polymorphism" in the standard do have some C++-specific meanings that are different from the general meanings, perhaps it's also OK to say "compilation and translation are the same thing" in the standard?

While "polymorphism" is somewhat probamatic with readers having some acadamic background, it should be relatively clear because there is the definition, and other meanings are not mentioned at all. Another example is "signature".

But translation/compilation is different. Even with the additional rules making them same, this is still confusing that: why we have 2 different words denoting the same meaning, instead of one? And there will be the problem about which to use in the normative text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants