Re construct, constructors are useful for other things too; for example 
maintaining type invariants and disallowing the uninhibited construction of 
instances in invalid states, for those types that demand it (opt-in by 
developer) - 
[https://github.com/nim-lang/RFCs/issues/48](https://github.com/nim-lang/RFCs/issues/48)
 \- together with immutability, it becomes very easy to to write safe code and 
the guarantees offered would enable certain optimizations that are otherwise 
expensive for the compiler to prove/compute (for example when attempting deep 
CTFE).

One thing to consider is the viral nature of immutability, as highlighted by 
`m(n) # error` \- it's another reason why it makes sense that the default is 
immutable - there will be much less friction for code reuse / libraries in the 
long run, even if during introduction of the feature, there will be slightly 
more work as some things will need to be relabeled as mutable. I suspect many 
bugs will be found around this time in said code. 

Reply via email to