raquo / Laminar

Simple, expressive, and safe UI library for Scala.js
https://laminar.dev
MIT License
741 stars 50 forks source link

Incremental Reactive Programming #14

Open fdietze opened 6 years ago

fdietze commented 6 years ago

I just found a few interesting papers which I think are very relevant for achieving efficient dom updates without virtual dom:

Maier, Ingo, and Martin Odersky. "Higher-order reactive programming with incremental lists." European Conference on Object-Oriented Programming. Springer, Berlin, Heidelberg, 2013.

Prokopec, Aleksandar, Philipp Haller, and Martin Odersky. "Containers and aggregates, mutators and isolates for reactive programming." Proceedings of the Fifth Annual Scala Workshop. ACM, 2014.

Reynders, Bob, and Dominique Devriese. "Efficient Functional Reactive Programming Through Incremental Behaviors." Asian Symposium on Programming Languages and Systems. Springer, Cham, 2017.

raquo commented 6 years ago

Thanks, these look interesting, I will give it a read eventually.

I'll keep this issue open until I add a section in documentation with useful resources like this.

raquo commented 1 year ago

Just adding some semi-relevant discussion on SignalMap as an alternative to split here:

https://discord.com/channels/1020225759610163220/1020225760075718669/1075918160915611849

https://github.com/armanbilge/calico/blob/20fc174d3f7f918049187e46369858af43292886/frp/src/main/scala/calico/frp/SignallingSortedMapRef.scala#L35

fdietze commented 1 year ago

And there is https://github.com/timelydataflow/differential-dataflow, and a discussion on how to use it as an alternative to virtual dom: https://github.com/TimelyDataflow/differential-dataflow/issues/154#issuecomment-470860673

armanbilge commented 1 year ago

Thanks for sharing that! This bit is quite interesting.

For example, for large lists, if you attach every item to its own differential dataflow, then that will make for blazing fast reconciliation, but probably cause all kinds of other problems (e.g. constant teardown and re-creation of dataflows as a user scrolls the list). Therefore I think that a hybrid approach might be best, where the heavy lifting is handled by Differential, and smaller batches are done via reconciliation.