3 ms·
There must be something wrong with me, but I don't get the Observable (the fact that its name is the same as that of a primitive in functional reactive programm
by azangru 7y ago
There must be something wrong with me, but I don't get the Observable (the fact that its name is the same as that of a primitive in functional reactive programming, as in rxjs, with which it has nothing to do, doesn't help either).
Observable seems to be a cross between Jupiter notebooks and plain old javascript, but sufficienly different from either to feel uncannily bizarre. Those imports in the bottom of a notebook! And I am still not sure whether it has access to the whole node_modules ecosystem or not (since it has to run in the browser and doesn't seem to involve a transpiler). I remember looking at some notebooks that involved React and thinking to myself that they felt plain wrong.
- mourner 7y agoThat's pretty unfair. Once you spend a little time to understand its concepts, it becomes second nature, and it's really a joy to use. The fact you can reorder cells in any way you want (and import cells from other notebooks) is the whole point — this way you can build narratives with code, embedding important bits in the story while leaving out fluff like imports at the bottom. Maybe you just haven't seen notebooks that take good advantage of this, but I'll shamelessly plug mine as an example: https://observablehq.com/@mourner/martin-real-time-rtin-terrain-mesh https://observablehq.com/@mourner/martin-real-time-rtin-terr... You do have access to nearly the whole NPM ecosystem. Most useful packages either provide a browser build in their package (which gets picked up automatically), or you can use https://bundle.run/ https://bundle.run/ to produce a browser bundle for any Node package.
- hashmal 7y ago> the fact that its name is the same as that of a primitive in functional reactive programming, as in rxjs, with which it has nothing to do, doesn't help either It's based on reactive programming though. Cells observe the entities mentioned in them and update accordingly when they change, which is why you can have imports at the bottom, and you don't have to care about cell evaluation order as with Jupyter Notebooks.
- jacobolus 7y ago> cross between Jupiter notebooks and plain old javascript More like a cross between literate programming and Excel, in a browser. I urge you to give it a shot for a few weeks. It is significantly different from other programming environments, and what at first might feel “uncannily bizarre” pretty quickly starts to like a huge leap forward.
- deleted 7y ago[deleted]
- WorldMaker 7y agoThe name Observable does have some indirect relation to rxjs, but by way of another historic fork in the reactive programming world of JS: Object.observe [1]. Albeit an obsolete tool today, with the recommendation is to use ES2015+ Proxy instead, Object.observe left other relatives of similar names in the web stack: IntersectionObserver, MutationObserver, others. The idea behind Observable is that it observes changes to cells (wherever they occur in document order) and reflects those changes everywhere else in the dependency tree, similar to databinding techniques like used in MobX or classic Knockout. (One way to think about Observable is that every cell is a Knockout "computed property".) [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...