Comments (7)
This can be fixed if we turn at the end of one evaluation, we can check whether any globals were assigned a reactive function, and treat them accordingly. @malyvsenrun_reactive!
into a recursive function:
from pluto.jl.
I'd rather fix that by simplifying our model: we could treat variables and functions alike. Each varfunc would have a SymbolsState
which is resolved when that varfunc (turning out to be a function!) is called. This could also work for getters, if Juia had getters - this thinking can be useful when we make Pluto.py
;)
In your example, g
would have its SymbolsState
copied from f
(or, better, just being a reference to it) - so the call to g
would be correctly identified as depending on y
.
from pluto.jl.
What should happen with g = rand(Bool) ? f : identity
?
from pluto.jl.
Good point! Seems like the SymbolsState
shouldn't be copied - each varfunc should have a set of references to SymbolStates
that it inherits from - and actually, those should just be the variables that are referenced when g
is assigned to, I think?
I'll modify the example a bit for clarity, let's say we have g = rand(Float64, x) < .5 ? f : h
- then g
should inherit from all of x
, f
, h
. This way, we might end up doing a bit too many updates, but I'd argue that, in the reactive paradigm, g
simultaneously depends on f
and h
because there is no knowing which of the two it'll be after a re-run. As for inheriting from x
- oh well, this isn't perfect :/ But we'll never end up updating too few cells this way so it's safe, though suboptimal.
To truly solve this problem, we would need to attach things to the variables themselves, I guess.
from pluto.jl.
That sounds like a good solution! It makes sense to derive reactivity just from syntax, and not from code evaluation.
Why should g
not inherit from x
?
from pluto.jl.
Would also make lambda functions reactive
from pluto.jl.
This is now a testset 🐸
It also meant reversing #25, recursion among functions now needs to be contained in a single cell, using a begin ... end
block. There was no way to make it work within the paradigm.
from pluto.jl.
Related Issues (20)
- error upon defining the functor Polynomial example from Julia docs HOT 1
- Live Docs: show package defining a function
- Fancyprint pkg logs: not throttled on slow connection
- Pluto v0.19.34 broken on start HOT 6
- Pluto input cell font size change HOT 3
- disabling the package manager doesn't work anymore HOT 6
- Unclear focus indication HOT 3
- Maximize screen real estate HOT 1
- Vertical cursor offset in Safari
- Opening the 3D Graph vs Heatmaps Featured notebook creates an infinite browser reload loop
- All cells appear as running when executing the notebook the first time HOT 2
- Visualize dependencies between cells HOT 1
- Tab order of codemirror and context menu
- Open button doesn't work on Windows HOT 4
- cell order fails with import of local modules HOT 1
- Issue when running macro. Not evaluating Symbols properly. HOT 4
- 🗣️ Improve screen reader support for reactive output changes
- Julia 1.10: support `@Kwargs{}` in stack traces
- Stack traces: kwargs shown at wrong place HOT 1
- Feature request: HTML Notebook Archive
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pluto.jl.