- A const is an abstracted value.
- A variable is an allocated piece of memory.
Like in C++, a const is absolutely allocated since you can get a pointer to one. And then you can do horrible stuff like const_cast that pointer and mutate the value, and the possibility of that occurring prevents the compiler from doing certain const-related optimizations.
If I understand you correctly, you claim you can get a pointer to a Go const. This is not the case. For example, the following code will not compile:
const a int = 1
var b *int = &a
./prog.go:5:15: cannot take the address of a
See https://go.dev/play/p/QPxP-tF6qIs for a live example.
And in C++, it certainly isn't. Even a constexpr in C++ is a thing you can get a pointer-to— C++'s only guarantee with a constexpr is that it has to be possible to evaluate it at compile time.
- as of right now they are different, and clearly distinct, and it's actually important to unlearn thinking of a const as a var, because they don't do the same thing in practical terms
- that proposal would muddy the distinction.
I mean we could let some const values allocated in memory.