i forgot to bring one point up and that is tracking internal mutability:
- i get that this might be a difficult line to draw given the coupling with js, but it’s not obvious that array is internally mutable. in the best of worlds, a->Array.push would fail unless you had something like let mut a = … but that still leaves the problem somewhat open (external vs internal mutability, also fields etc). we use a (not super-pleasant) suffix of
Mutfor all vars that we intentionally mutate (e.g.,storeMutorconcatedStrMutbut this is not really enough (and we make mistakes lol). it’s just hard to track mutability, especially if we pass arrays into functions, you have to trust that whoever wrote the function either is sane enough to not mutate it without documenting it (turns out we have insane people in our team) and/or copy it if they do. are there any plans to address this? we even considered aliasing Array etc with Belt variants to enforce immutability.