Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

My main gripes with rescript (constructive criticism)

$
0
0

i forgot to bring one point up and that is tracking internal mutability:

  1. 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 Mut for all vars that we intentionally mutate (e.g., storeMut or concatedStrMut but 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.

Viewing all articles
Browse latest Browse all 2592

Trending Articles