knowing neither of these languages i’d rather it be labeled something more clear as neither one of those screams immutable to me. the immutable variant should use the ‘const’ keyword instead.
I hope they won't use const. The meaning of it is extremely overloaded in C++.
Const variables are traditionally initialized at compiled time. In Swift, let may be initialized at runtime and then becomes immutable.
that’s just a choice by the language designer. nothing prohibits initialization at runtime.
To me `var` by definition means mutable and `let` sounds like you're laying out a constant in a proof, so I'd say both are pretty clear.
they both sound exactly the same to me, let sounding like an alias for var.
also programs aren’t proofs so we certainly shouldn’t name keywords after them
Well Nim also has `const` the difference is that `const` must be evaluated in compile time, but `let` is just to prevent reassignments, more info: https://nim-lang.org/docs/tut1.html#constants which is different than what JavaScript does.
3 people now saying the same thing. const is not required to be interpreted at compile time, these are choices made by language designers. and read the code with ‘let’ in it like it’s english, does let actually describe constnenss using its english definition? no. i’d argue that any language using ‘let’ for const values is borderline too theoretical. hell, even “define” is better than “let”