-
Notifications
You must be signed in to change notification settings - Fork 144
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Stateful variables (streams, live variables, reactivity, ... whatever we call it) #169
Comments
Imagine a runtime like Haskell's STG, except that it allowed mutable variables. Of course, if you mutate a variable, then you break purity and referential transparency... but not if you "notify" every thunk or expression that depended on the mutable variable, and then re-compute their values. It would be as if a physics constant changed and the whole universe was re-computed to consider it. Something like that would allow, say, react-like UI management without needing to compute diffs. I think it is a fun concept and I could see a runtime based on it. It can also probably be easily modeled in Kind, using monads to have a nice syntax for it. But other than that I don't think there is much else to say about it. I don't see any interesting / compelling use other than UIs. |
Do you have anything specific in mind?
Yep, it's for UI of all kind. But UIs are important - even |
Not in mind, just a guess.
Fair enough, but when it comes to UIs, we're currently betting on React-like interfaces. Check the apps on http://uwu.tech/ currently. So observables isn't something I plan to invest on anytime soon. |
Sounds rather heavy-weight and not so quick to develop & maintain. Have you also considered a bit lighter-weight paradigms? E.g. something like:
It can also be seen as a form of pub sub pattern - so even https://github.com/moothyknight/JS_UI_Utils would do the job in the end.
Looks good to me (assuming the size of the generated JS files will get smaller at some point). |
As a side note, there is also a whole language which has all variables "live" - see https://github.com/mech-lang (it's based on what the Eve language achieved - the video shows what such "live" functional-declarativeness offers - and it's not negligible!). |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
What could be the most convenient way to model something like https://github.com/MaiaVictor/PureState in Kind?
I'm starting to tinker with Kind a bit, but I'm still too far away from writing anything bigger than hello world 😉.
The text was updated successfully, but these errors were encountered: