Replies: 7 comments 3 replies
-
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. |
Beta Was this translation helpful? Give feedback.
-
Do you have anything specific in mind?
Yep, it's for UI of all kind. But UIs are important - even |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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). |
Beta Was this translation helpful? Give feedback.
-
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!). |
Beta Was this translation helpful? Give feedback.
-
Actually, this is the knowledge that most programming communities don't weigh much. That is rarely mentioned and I share the idea. This is basically FRP and composes Directed async graph(DAG)
Yes, I have implemented in TypeScript. https://codesandbox.io/s/demo0-helloio-2pvr8?from-embed |
Beta Was this translation helpful? Give feedback.
-
@dumblob https://gist.github.com/stken2050/eab59867451a51a9d6a0c454e101651a Actually, this code is a part of my online programming tutorial book (Japanese and translating to English now). https://kentutorialbook.github.io/functionalprogramming2022/ |
Beta Was this translation helpful? Give feedback.
-
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 😉.
Beta Was this translation helpful? Give feedback.
All reactions