Relatively poor performance resulting from the use of non-const global variables comes up quite often in Julia context. Wouldn’t it be better if variables were
const by default? Or at least global variables. If a non-const global is really needed, one could write
julia> mutable x=3.14 3.14 julia> x="abc" "abc"
julia> y=3.14 3.14 julia> y="abc" ERROR: invalid redefinition of constant y ...
(This is of course not true output from present Julia 1.3.1)
mutable a different word could be used for variables, like
typemutable which., however, seems a too long word.
The proposal would break existing code (perhaps a lot?). It is therefore aimed at a future major version upgrade of Julia.