Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive (Incremental) programming effects library #3

Open
awto opened this issue Mar 10, 2018 · 0 comments
Open

Adaptive (Incremental) programming effects library #3

awto opened this issue Mar 10, 2018 · 0 comments

Comments

@awto
Copy link
Owner

awto commented Mar 10, 2018

One of many possible effects EffectfulJS may support is an Adaptive (Incremental) programming. Namely re-executing only parts of the code when some dependency changes. Like Mobx @computed property but not re-executing the whole function, only a part (delimited continuation) to reflect the changes in variables. These may be loops, other functions calls etc - some heavy computations.

For example, if there is a huge data grid and we want to render only a visible part of it (with possibly applied filtering, sorting etc). We can write simple for-of loop rendering the grid between starting and finishing position, and if the variables change (on scrolling), or new data arrive from a server only the changed parts rerender, without even using special component, they typically lack some required feature. Or, imagine, it is a game scene rendering where some object changes but the code doesn't bother on handling the changes, it just renders the whole scene once, the rest is handled by the underlying framework.

I believe it is fairly easy to utilize Mobx or derivablejs for this. From EffectfulJS it will receive proper continuations (which may be fired more than once). And they are used called the same way @computed properties are called on dependency change. There is already delimited continuations effects library to be utilizied, only dataflow dependency tracking engines must be integrated.

A couple of links about Adaptive Programming (though they are about functional programming)

Adaptive Functional Programming
Monads for Incremental Computing
Traceable Data Types for Self-Adjusting Computation - mobx supports only adaptive references, this describes how to extend to more advanced types, like sorted maps.
This is based on rather complex functional programming concepts but end-user won't need to know them to use. They will just write plain JS programs.

This is based on rather complex functional programming concepts but end-user won't need to know them to use. They will just write plain JS programs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant