Type Fixing

If this were true, than typescript wouldn't exist, because it offers no speed increases at all once it compiles. What people want from types is "code stability".

Your primary argument for this added syntax seems to be that you want to provide users with the ability to micro-optimize their code a little bit more - it seems to have nothing to do with usability. Is this correct?

This sounds like a hard thing to sell, as such a performance feature would be useless in most code, simply because the micro performance gain would be shadowed by other, more non-performant coding choices. I've written before over here about tons of different ways people can micro-optimize code today. A feature such as this "fixed" keyword should not be used, unless the user is also doing all sorts of other, unreadable tricks to micro-optimize their code, and such micro-optimization should only happen in small sections of code that actually need the performance gains (trying to squeeze every last nano-second out of your program will just cause you to write buggy code).

And, if you're actually writing code that needs to be extremely efficient, then it might be better to encourage developers to choose a language like Rust for the performance-critical portions (and compile it to web-assembly), rather than providing little micro-optimization syntaxes such as "fixed".

If your argument for "fixed" was about usability/readability instead, then that's a whole different story. But, as you mentioned, we already have "const" which arguably does a better job on the usability side of things.

1 Like