Closed alandipert closed 10 years ago
We've decided to defer this until we're confronting real problems that we can attribute to dynamic graphs.
Open questions include: what should we do when a cycle is detected? what's the relationship between this and reference counting, another feature that might be useful for dynamic graphs?
Background
Currently a cycle in the
Cell
graph trashes the browser and no additional information is provided about its cause.The current behavior is tenable because:
The Enhancement
In more dynamic scenarios the cause of a cycle can be more difficult to determine. These are scenarios in which the shape of the dataflow graph is changing while the program is running, instead of it having a fixed shape determined in source code.
I think a worthy enhancement would be to detect cycles at runtime and notify the developer of their presence, programatically, with as much information as possible without introducing significant overhead.
This would ease development of dynamic dataflow applications and would also amene dynamic Javelin graphs to generative testing.
Implementation Idea
The Flapjax paper mentions the cycle detection approach taken in Garnet and Amulet:
I think we can do the same thing very easily. In
propagate!
, we store the cells we've propagated so far in a set. When we encounter a cell we've already processed a second time, we throw an exception.The Garnet/Amulet "Lessons Learned" paper elaborates slightly: