Skip to content

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鈥檒l 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

Closed
dumblob opened this issue Apr 14, 2021 · 5 comments
Labels
question Further information is requested

Comments

@dumblob
Copy link

dumblob commented Apr 14, 2021

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 馃槈.

@VictorTaelin
Copy link
Member

VictorTaelin commented Apr 16, 2021

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.

@dumblob
Copy link
Author

dumblob commented Apr 16, 2021

It can also probably be easily modeled in Kind, using monads to have a nice syntax for it.

Do you have anything specific in mind?

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.

Yep, it's for UI of all kind. But UIs are important - even printf() is UI, so I feel this concept be quite useful in most apps 馃槈. Such "live" UIs (including distant collaboration!) are yet to become ubiquitous IMHO.

@VictorTaelin
Copy link
Member

Do you have anything specific in mind?

Not in mind, just a guess.

Yep, it's for UI of all kind. But UIs are important - even printf() is UI, so I feel this concept be quite useful in most apps 馃槈. Such "live" UIs (including distant collaboration!) are yet to become ubiquitous IMHO.

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.

@MaisaMilena MaisaMilena added the question Further information is requested label Apr 16, 2021
@dumblob
Copy link
Author

dumblob commented Apr 16, 2021

Fair enough, but when it comes to UIs, we're currently betting on React-like interfaces.

Sounds rather heavy-weight and not so quick to develop & maintain. Have you also considered a bit lighter-weight paradigms? E.g. something like:

  1. https://github.com/adamhaile/S (like PureState but minimizing the "problem with conditions")
  2. https://github.com/WebReflection/domdiff (I usually prefer this one among other options here)
  3. https://github.com/ajnsit/concur-js (inspiration in Haskel concur)
  4. https://github.com/ms-jpq/noact (tiny React)
  5. https://github.com/sweetpalma/gooact (tiny React)
  6. https://github.com/zserge/o (tiny React)
  7. https://github.com/paldepind/flyd (explicit streams - quite verbose, but it gets the job done)

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.

Check the apps on http://uwu.tech/ currently.

Looks good to me (assuming the size of the generated JS files will get smaller at some point).

@dumblob
Copy link
Author

dumblob commented Apr 22, 2021

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!).

@rigille rigille closed this as completed Jun 29, 2021
@HigherOrderCO HigherOrderCO locked and limited conversation to collaborators Jun 29, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants