carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
http://docs.carbon-lang.dev/
Other
32.28k stars 1.48k forks source link

New name for "constant" value phase #1391

Closed josh11b closed 1 year ago

josh11b commented 2 years ago

(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 commented 2 years ago

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:

chandlerc commented 2 years ago

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 commented 2 years ago

! is typically associated with negating a value or use within the inequality operator.

I'm not sure const comes to anyone's mind when they see !. Remember to make a language as readable and inviting as possible. There's a reason we don't all use Rust.

chandlerc commented 1 year ago

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

https://github.com/carbon-language/carbon-lang/issues/1391#issuecomment-1185245169

Marking this as decided!

Turbine1991 commented 1 year ago

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

#1391 (comment)

Marking this as decided!

To be quite honest, if it's too different to other languages. People may as well learn Rust. This language will likely be sidetracked to some existing projects which will get updates.

I've given up on Carbon and started learning Rust as it's nothing like C++/Javascript/C# syntactically, and Rust is almost just as different.

chandlerc commented 1 year ago

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 commented 1 year ago

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.

It was constructive criticism to not alienate the C++ folk.

chandlerc commented 1 year ago

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.

It was constructive criticism to not alienate the C++ folk.

Not for this issue. This issue is about a terminology question in how we explain Carbon. The feedback is not specific to this terminology and doesn't connect it to alienating C++ folks. I really am happy to engage and discuss this topic, but it doesn't belong on this issue. If you'd like to have a constructive and friendly discussion about the tradeoffs around familiarity for C++ folks, please start a fresh thread, ideally in the "discussions" part of GitHub.

I'm going to hide the new comment and this comment to keep this issue focused. Please do not continue to ignore moderator feedback on where to have discussions.