Stéphane Ducasse wrote:
However, since VW already implements immutability, it would probably be beneficial to chose an API that is close to the VW implementation.
Yes this is the idea. I hope the interface is good.
The interface in base VW is, I'm afraid, not good, and should not be emulated. However, the WriteBarriers parcel, in preview in VW 7.7, is a start at a better API for this. The basic problem is that the underlying VM "immutability" feature is useful for many things besides immutability. But the API is designed only for immutability, and using it for anything else is very ugly. It was probably a mistake to name the VM feature "immutability" in the first place. It's really "trap on write" and when you get a trap you can do many things -- reject the modification, conditionally allow it, notify then allow... Regards, -Martin