It should be possible to have a platform that has a mutable reference with an API like this:
main =
x = pf.NewRef!
pf.Write! x 5
y = pf.Read! x