5 ms·
As much I try to like ObservableHQ, this "updates happen above the code, sometimes a bit far, so you if you scroll too much, you don't see them" is one thing th
by stared 7y ago
As much I try to like ObservableHQ, this "updates happen above the code, sometimes a bit far, so you if you scroll too much, you don't see them" is one thing that makes it less intuitive than Jupyter Notebook style.
It took me some time to realize that running cells actually change something in the country list.
- pphysch 7y agoIt's not just a Jupyter Notebook But In JS, though. Dynamically interacting with the DOM is perhaps the core feature of Observable, while Jupyter/iPython very much embraces the strict imperative style (ipywidgets etc being more a nice hack than anything) While I do think there could be UX improvements, I don't think this is a flaw in Observable.
- stared 7y agoI think that in JS there is much more potential for interaction (as frontend IS JavaScript; for Python and other languages, it is this language + JavaSript). Yes, ipywidgets are hacks (as many other interactive things). So, I am surprised that there is no standalone REPL in that style. The closest things I've found are ObservableHQ and RunKit (the other is much more Jupyter-like, but still - AFAIK runs code in the backend).
- kickout 7y agoAlways viewed this as a good feature, not a bug
- TeMPOraL 7y agoIt's a feature, not a bug. ObservableHQ notebooks are reactive - there's a DAG underneath. It's not a Jupyter-style execution log.
- K0SM0S 7y ago> there's a DAG underneath Would you or someone care to elaborate? Do we mean the 'linking' between 'nodes' (cells) as an interpreter/compiler would do over a file/object structure? Thus I assume, opening a world of options e.g. for vectorizing performance, type checking and all? If so, we have in one such notebook a true slice of "visual" IDE the kind of which Microsoft could only ever dream about! (so far) ;-) [Side-related note: I'm amazed at the emergence of the notebook paradigm over the last 10 years, accelerating for at least 2-4 now. See how they do it at Netflix. There's a case to be made that the notebook paradigm could really bridge wide open the "programming rift" between nerds and, well, everybody else, at least in skill-driven professional contexts. There's a short way from here to a slew of clever domain-driven script languages plugging straight into BI.]
- TeMPOraL 7y ago> Would you or someone care to elaborate? Do we mean the 'linking' between 'nodes' (cells) as an interpreter/compiler would do over a file/object structure? A DAG, or Directed Acyclic Graph. The most familiar example would be dependency graphs between packages. Or the dependency graph of your code (as interpreter/compiler would look at it). Or, any dependency graph in general. So the way reactive programming works - whether in React, ObservableHQ, or Excel - is this: you have these computation units (cells, pure functions) which have dependencies and they themselves are dependent upon. This forms your calculation graph, which you calculate by starting at the node without dependencies and evaluating one node after another in topological order[0]. The main optimization this permits is reducing the number of calculations: since dependencies are accounted for and navigable, whenever a node X changes, only nodes that depend on it need to be recomputed (and their dependants, recursively). "vectorizing performance, type checking and all" are not related to this concept. Reactive programming deals just with the dependency graph and (re)computing the right amount of nodes in the right order. Contrast that with a typical REPL model (or Jupyter model), where you execute cells one after another in the order you wrote them, and they mutate the global state of the application. RE your side note: yes, the notebook thing is a curious phenomenon, especially in a worse-is-better way (why did it have to be first Python, and now JavaScript?!). It's much older than that, though - you could trace its origin through things like Mathcad (essentially a buggy Jupyter requiring lots of clicking, but which produced a convincingly-looking math papers, and could do proper symbolic calculations out of the box), back to the early Lisp era (you don't have to type things into a Lisp REPL; if you type them in a file and annotate with comments as you go, you get a half-baked plaintext Jupyter). -- [0] - https://en.wikipedia.org/wiki/Topological_sorting https://en.wikipedia.org/wiki/Topological_sorting - i.e. you turn a graph into a sequence sorted so that the dependencies come before the things that depend on them.
- K0SM0S 7y agoAh, I see now, thank you very much for the detailed explanation. Having used Excel for years as a barebones "logical framework" of sorts (before I knew better, in my teens, to solve various optimization problems in games notably like "best in slot" or "best resource distribution"), I've internalized a deep intuition for reactive programming. I had never realized this was an actual paradigm! On optimization / O(n), models tend to (d)evolve into highly recursive 'traps' with this approach, in my experience. I learned the value of e.g. indexes, isolating concerns, generally larger but flatter surfaces indeed. RE notebooks: I had no idea there was such a history of that. It's interesting that the approach only became somewhat popular recently.