If you assigned something to the system clock, it would act like an interval timer, for example.
If you assigned something to the system clock, it would act like an interval timer, for example.
The language can help with debugging by providing traces of execution that you can record and replay to inspect. Then you can query the trace to answer any questions you have about the execution of the program.
It gets messy fast, and I absolutely would not want to debug a big program that was full of implicit dependencies like this. This was tried in Java FX. AFAIK it was a total disaster.
The issue with reactive, declarative languages is they have not been given the same opportunity to optimize. We've devoted a lot of resources to making imperative programming more accommodating despite all of its warts, but with declarative programming so far we have decline to go through the same process.
Declarative reactive programming has proven to have a lot of potential. After all, if we call Excel a programming language (which it is), then reactive programmers far outnumber those of any other style. We should take that direction as far as it can go. Mine it for every good idea the same way imperative programming has been mined. Sure maybe JavaFX was a total disaster. But why can't its successor be better? Why exactly was it a disaster? What could potentially be done to improve that?
a::b*c; b:2; c:3; a results in a being equal to 6, and if you update b or c a will update too.
a = 10
b = 20
c = a * b
s = "{c}"
widget.display(s) -- will show '200' at the start
a = 2 -- c = 40 and widget shows '40'
It's like a spreadsheet. In a pull system, each dependent would have to periodically update itself, which means they'd be doing unnecessary work when there haven't been changes, and be stale (for longer than necessary) when there have been changes.