I like this proposal!
The only comment I have is that I like language features that encourage "fast by default" writing. In C++, it's annoying to see constexpr static
written everywhere.
I understand that in C++ and Swift, the compiler is good at optimizing and you don't need to use @const
everywhere, and that's fair. In the previous proposal, one reason I liked const
instead of let
, is because it allows me to use "build-time constant values" as a default.
When it comes to protocols and libraries, overusing @const
is certainly an anti-pattern and should be avoided. Again, most of my ire comes from seeing a bunch of ugly constexpr static
and preferring something like const
in Rust.