vvvv / VL-Language

The official repo for the design of the VL programming language
31 stars 0 forks source link

[Import Proposal] Wrap descriptive Object Graphs in an immutable fashion #31

Open gregsn opened 4 years ago

gregsn commented 4 years ago

A solution for https://github.com/vvvv/VL-Language/issues/30

The advantage of having a snapshot-based high-level node-set: The user isn't forced to build trees. grafik Here two different paints got described by an object graph.

Implementation

Clone-based

Summary

This solution is high-level and versatile. The user has a large degree of freedom. The patches are readable so that no special UI is needed. Low-level nodes that work with the original type are barely needed as all the properties got wrapped by high-level Setter process nodes. Theoretically we still could expose the low-level nodes and make the snapshots expose the wrapped original instance in order to glue to those low-level nodes.

The implementation has the downside that whenever any property is animated we end up cloning instances of the original type all the time.

Sync-based

Summary

Same advantages as the solution above.

The implementation has the downside that whenever any property is animated we end up comparing all properties on all sinks in order to synchronize the description with the actual thing.