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

New name for "constant" value phase #1391

Closed
josh11b opened this issue Jul 15, 2022 · 8 comments
Closed

New name for "constant" value phase #1391

josh11b opened this issue Jul 15, 2022 · 8 comments
Labels
leads question A question for the leads team

Comments

@josh11b
Copy link
Contributor

josh11b commented Jul 15, 2022

(separate from the question of whether the value phases are actually just value categories)

The thing we want to name is "a value that is known at type-checking time" in contrast to "symbolic value", which is a value that will be known at code generation / monomorphization time but type checking is done without knowing its value, or "runtime value" which is not known until runtime.

Original suggestion for this name in #typesystem on Discord. Suggestion to find a new name in PR #1378.

@mconst
Copy link
Contributor

mconst commented Jul 15, 2022

I've been warming up to the idea of referring to all :! values as "constants", and the ones with template :! as "template constants". Some things I like about this nomenclature:

  • it exactly matches our syntax
  • it matches people's intuition that a constant is something known at compile time
  • it correctly implies that template constants are more specialized, and non-template constants are the normal thing you should use in ordinary code
  • these names are natural enough that I think users will try to use them, whether they're our official terms or not! As @chandlerc pointed out in https://github.com/carbon-language/carbon-lang/pull/1378/files#r921592116, users will want to refer to all :! values as constants, so it's great if we can make that the actual name.

@chandlerc
Copy link
Contributor

I've been warming up to the idea of referring to all :! values as "constants", and the ones with template :! as "template constants".

Slight tweak that preserves many of the benefits that I want to mention:

:! -> "symbolic constants"

template _:! -> "template constants"

The idea being that they are both constants, symbolic ones unavailable at type-checking, template available.

I'm not advocating one way or the other, just floating it so we can think about it. I'm still pondering a bit.

@Turbine1991

This comment was marked as off-topic.

@jonmeow jonmeow added the leads question A question for the leads team label Aug 10, 2022
@chandlerc
Copy link
Contributor

Just confirming that the leads are happy with the tweaked names here:

#1391 (comment)

Marking this as decided!

@Turbine1991

This comment was marked as off-topic.

@chandlerc
Copy link
Contributor

Just a quick reminder to not use specific issues to post more general feedback -- that should happen on its own discussion thread. Also, please keep feedback constructive.

@Turbine1991

This comment was marked as off-topic.

@chandlerc

This comment was marked as off-topic.

github-merge-queue bot pushed a commit that referenced this issue Jul 6, 2023
Update terminology around expression properties:

-   "value phase" -> "expression phase"
-   "symbolic value" -> "symbolic constant"
-   "constant" -> "template constant"
-   "constant or symbolic value" -> "constant"

Implements the decision in #1391 .

---------

Co-authored-by: jonmeow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
leads question A question for the leads team
Projects
None yet
Development

No branches or pull requests

5 participants