MemoizR icon indicating copy to clipboard operation
MemoizR copied to clipboard

comparing to RX.NET

Open luxl opened this issue 1 year ago • 2 comments

feels like with reactive programming, is there any advantages over it?

luxl avatar Dec 23 '23 05:12 luxl

At the Moment:

If you have a reactivity graph you will eventally run into things like the Diamond Problem. These Problems are solved out of the box in MemoizR (Signal implementations in general) where as with all the ReactiveX implementations these problems are not trivial to solve.

MemoizR is built with async in mind from the start, RX.Net only added AsyncRx recently and it is not production ready as of now. Rx.Net preceeds async await and therefore is not optimized for the modern way of writing C#.

There are a lot more advantages, like automatic/no subscription handling and all the problems that get solved from that.

But the biggest advantages over RX.Net in my opinion are probably not quite objective. I think the code that results from using MemoizR is easier to read/maintain because it is a lot closer to the traditional structured programming concepts used in modern C#.

In the frontend space Signals seem to win over rxjs. But MemoizR is a lot more than just a Signal implementation. It adds Declarative Structured Concurrency and Signal Operators which make it a lot more comparable to ReactiveX than the Signal implementations we see in the FE space.

Evolution of Signals

With MemoizR you can start simple and add complexity only as you need it. And a lot of the complexities are handeled out of the box. In conclusion: There are a lot less foot guns on the way compared to RX.Net

timonkrebs avatar Dec 23 '23 07:12 timonkrebs

Big advantages come from features that will be possible to implement with MemoizR that do not fit into the ReactiveX model.

For example:

  • Structured Concurrency enables much more control over cancellation and scheduling over ReactiveX. This enabels back-pressure strategies not present in ReactiveX backpressure operators
  • In MemoizR there is a concept of current state per node. Which is a lot more deterministic than with ReactiveX. This will enable working in a distributed graph with MemoizR that is not possible with RX.Net
  • Serializing the dependency graph in ReactiveX is not really possible, whereas with MemoizR it is straight forward. This enables features that will not be possible with RX.Net. (eg. Enabels Resumability)
  • And more

timonkrebs avatar Dec 23 '23 09:12 timonkrebs