News for hackers. Stuff that matters.
Re:High-order Virtual Machine (HVM): Massively parallel, opt... by LightMachine on Saturday February 05, 2022 @03:35PM (#30225672)
Since HVM is linear, adding some mutability would be completely fine and would NOT break referential transparency (because values only exist in one place!). So, we could actually have "pure mutable arrays". In order to make that mix up well with lazy cloning, though, we'd need to limit the size of array to about 16. But larger arrays could be made as trees of mutable 16-tuples. There was a post about it, but I can't find it right now.
Re:High-order Virtual Machine (HVM): Massively parallel, opt... by auggierose on Sunday February 06, 2022 @05:37AM (#30231234)
That makes sense to me; I am currently implementing a package with mutable data structures with shallow constant time cloning (via copy-on-write) for TypeScript, and the dup idea somehow seems to be compatible with that.
Re:High-order Virtual Machine (HVM): Massively parallel, opt... by lcedp on Sunday February 13, 2022 @04:53PM (#30326041)
But wouldn't it make mutability only useful in local scopes?

```

fn f(x) { *x = 42 // lazily cloning on write };

let x = 1; f(x); // x still equals 1 here

```