News for hackers. Stuff that matters.
Re:High-order Virtual Machine (HVM): Massively parallel, opt... by auggierose on Saturday February 05, 2022 @01:23PM (#30224013)
And another question, is this for purely functional code only, or does it / could it also apply to mutable data structures. In particular, is it somehow related to copy-on-write techniques (like for example used for Swift's data structures), or is this something entirely different?
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

```

Re:High-order Virtual Machine (HVM): Massively parallel, opt... by herbstein on Saturday February 05, 2022 @03:04PM (#30225266)
Based on my understanding on the HOW.md text this relies heavily on mathematical equality for performance. In its execution it is essentially constantly inlining operations as it goes.